File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
CoreFoundation/Base.subproj Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1171,10 +1171,20 @@ CF_EXPORT
11711171
11721172CF_PRIVATE os_unfair_recursive_lock CFPlugInGlobalDataLock ;
11731173
1174+ #if __HAS_DISPATCH__
1175+ extern void libdispatch_init ();
1176+ #endif
1177+
11741178void __CFInitialize (void ) {
11751179 if (!__CFInitialized && !__CFInitializing ) {
11761180 __CFInitializing = 1 ;
11771181
1182+ #if __HAS_DISPATCH__
1183+ // libdispatch has to be initialized before CoreFoundation, so to avoid
1184+ // issues with static initializer ordering, we are doing it explicitly.
1185+ libdispatch_init ();
1186+ #endif
1187+
11781188 // This is a no-op on Darwin, but is needed on Linux and Windows.
11791189 _CFPerformDynamicInitOfOSRecursiveLock (& CFPlugInGlobalDataLock );
11801190
You can’t perform that action at this time.
0 commit comments