static bool DetachThread() { if (s_ThreadInitialized == OS_INVALID_TLS_INDEX) return true; if (OS_GetTLSValue(s_ThreadInitialized) == 0) return true; bool success = true; if (!OS_SetTLSValue(s_ThreadInitialized, (void *)0)) { assert(0 && "DetachThread(): Unable to clear init flag."); success = false; } FreeGlobalPools(); if (!FreeParseContext()) success = false; return success; }
bool DetachThread() { bool success = true; if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) return true; // // Function is re-entrant and this thread may not have been initalised. // if (OS_GetTLSValue(ThreadInitializeIndex) != 0) { if (!OS_SetTLSValue(ThreadInitializeIndex, (void *)0)) { assert(0 && "DetachThread(): Unable to clear init flag."); success = false; } FreeGlobalPools(); if (!FreeParseContext()) success = false; } return success; }