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() {
582582#endif
583583
584584static pthread_key_t __CFTSDIndexKey ;
585+ static pthread_once_t __CFTSDIndexKey_once = PTHREAD_ONCE_INIT ;
585586
586- CF_PRIVATE void __CFTSDInitialize () {
587+ CF_PRIVATE void __CFTSDInitializeOnce () {
587588 (void )pthread_key_create (& __CFTSDIndexKey , __CFTSDFinalize );
588589}
589590
591+ CF_PRIVATE void __CFTSDInitialize () {
592+ (void )pthread_once (& __CFTSDIndexKey_once , __CFTSDInitializeOnce );
593+ }
594+
590595static void __CFTSDSetSpecific (void * arg ) {
591596#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI
592597 pthread_setspecific (__CFTSDIndexKey , arg );
You can’t perform that action at this time.
0 commit comments