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 @@ -580,11 +580,16 @@ CF_PRIVATE void __CFFinalizeWindowsThreadData() {
580
580
#endif
581
581
582
582
static pthread_key_t __CFTSDIndexKey ;
583
+ static pthread_once_t __CFTSDIndexKey_once = PTHREAD_ONCE_INIT ;
583
584
584
- CF_PRIVATE void __CFTSDInitialize () {
585
+ CF_PRIVATE void __CFTSDInitializeOnce () {
585
586
(void )pthread_key_create (& __CFTSDIndexKey , __CFTSDFinalize );
586
587
}
587
588
589
+ CF_PRIVATE void __CFTSDInitialize () {
590
+ (void )pthread_once (& __CFTSDIndexKey_once , __CFTSDInitializeOnce );
591
+ }
592
+
588
593
static void __CFTSDSetSpecific (void * arg ) {
589
594
#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
590
595
pthread_setspecific (__CFTSDIndexKey , arg );
You can’t perform that action at this time.
0 commit comments