--- src/common/system_utils.cpp.orig 2025-11-04 00:40:17.000000000 +0800 +++ src/common/system_utils.cpp 2025-11-04 00:40:39.000000000 +0800 @@ -17,7 +17,6 @@ #endif #if defined(ANGLE_PLATFORM_APPLE) -# include # include #endif @@ -248,11 +247,15 @@ { static std::atomic globalThreadSerial; static pthread_key_t tlsIndex; - static dispatch_once_t once; - dispatch_once(&once, ^{ + static pthread_once_t once = PTHREAD_ONCE_INIT; + + auto initKey = []() { auto result = pthread_key_create(&tlsIndex, nullptr); ASSERT(result == 0); - }); + }; + + pthread_once(&once, +initKey); + void *tlsValue = pthread_getspecific(tlsIndex); if (ANGLE_UNLIKELY(tlsValue == nullptr)) {