File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
CoreFoundation/Base.subproj Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -582,11 +582,16 @@ CF_PRIVATE void __CFFinalizeWindowsThreadData() {
582
582
#endif
583
583
584
584
static pthread_key_t __CFTSDIndexKey ;
585
+ static pthread_once_t __CFTSDIndexKey_once = PTHREAD_ONCE_INIT ;
585
586
586
- CF_PRIVATE void __CFTSDInitialize () {
587
+ CF_PRIVATE void __CFTSDInitializeOnce () {
587
588
(void )pthread_key_create (& __CFTSDIndexKey , __CFTSDFinalize );
588
589
}
589
590
591
+ CF_PRIVATE void __CFTSDInitialize () {
592
+ (void )pthread_once (& __CFTSDIndexKey_once , __CFTSDInitializeOnce );
593
+ }
594
+
590
595
static void __CFTSDSetSpecific (void * arg ) {
591
596
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
592
597
pthread_setspecific (__CFTSDIndexKey , arg );
You can’t perform that action at this time.
0 commit comments