Replace pthread specifics with C11 thread-local variables (#811)

* Replace pthread specifics with C11 thread-local variables for speed and safety

* Increment changelog
This commit is contained in:
Adlai Holler
2018-02-28 12:42:30 -08:00
committed by GitHub
parent 6b57b1cf1a
commit a1055254f7
6 changed files with 17 additions and 54 deletions

View File

@@ -211,15 +211,6 @@
#define AS_SUBCLASSING_RESTRICTED
#endif
#define ASPthreadStaticKey(dtor) ({ \
static dispatch_once_t onceToken; \
static pthread_key_t key; \
dispatch_once(&onceToken, ^{ \
pthread_key_create(&key, dtor); \
}); \
key; \
})
#define ASCreateOnce(expr) ({ \
static dispatch_once_t onceToken; \
static __typeof__(expr) staticVar; \