mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
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:
@@ -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; \
|
||||
|
||||
Reference in New Issue
Block a user