bool FreeParseContextIndex() { OS_TLSIndex tlsiIndex = GlobalParseContextIndex; if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) { assert(0 && "FreeParseContextIndex(): Parse Context index not initalised"); return false; } GlobalParseContextIndex = OS_INVALID_TLS_INDEX; return OS_FreeTLSIndex(tlsiIndex); }
bool DetachProcess() { bool success = true; if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) return true; ShFinalize(); success = DetachThread(); FreePoolIndex(); OS_FreeTLSIndex(ThreadInitializeIndex); ThreadInitializeIndex = OS_INVALID_TLS_INDEX; return success; }
void C_DECL Hlsl2Glsl_Shutdown() { if (s_ThreadInitialized == OS_INVALID_TLS_INDEX) return; if (PerProcessGPA) { SymbolTables[EShLangVertex].pop(); SymbolTables[EShLangFragment].pop(); PerProcessGPA->popAll(); delete PerProcessGPA; PerProcessGPA = NULL; } DetachThread(); FreePoolIndex(); FreeParseContextIndex(); OS_FreeTLSIndex(s_ThreadInitialized); s_ThreadInitialized = OS_INVALID_TLS_INDEX; }
void FreePoolIndex() { // Release the TLS index. OS_FreeTLSIndex(PoolIndex); }