bool InitProcess() { glslang::GetGlobalLock(); if (ThreadInitializeIndex != OS_INVALID_TLS_INDEX) { // // Function is re-entrant. // glslang::ReleaseGlobalLock(); return true; } ThreadInitializeIndex = OS_AllocTLSIndex(); if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) { assert(0 && "InitProcess(): Failed to allocate TLS area for init flag"); glslang::ReleaseGlobalLock(); return false; } if (! InitializePoolIndex()) { assert(0 && "InitProcess(): Failed to initalize global pool"); glslang::ReleaseGlobalLock(); return false; } InitThread(); glslang::ReleaseGlobalLock(); return true; }
static bool InitProcess() { if (s_ThreadInitialized != OS_INVALID_TLS_INDEX) return true; s_ThreadInitialized = OS_AllocTLSIndex(); if (s_ThreadInitialized == OS_INVALID_TLS_INDEX) { assert(0 && "InitProcess(): Failed to allocate TLS area for init flag"); return false; } if (!InitializePoolIndex()) { assert(0 && "InitProcess(): Failed to initalize global pool"); return false; } if (!InitializeParseContextIndex()) { assert(0 && "InitProcess(): Failed to initalize parse context"); return false; } InitThread(); return true; }
bool InitProcess() { if (ThreadInitializeIndex != OS_INVALID_TLS_INDEX) { // // Function is re-entrant. // return true; } ThreadInitializeIndex = OS_AllocTLSIndex(); if (ThreadInitializeIndex == OS_INVALID_TLS_INDEX) { assert(0 && "InitProcess(): Failed to allocate TLS area for init flag"); return false; } if (!InitializePoolIndex()) { assert(0 && "InitProcess(): Failed to initalize global pool"); return false; } if (!InitializeParseContextIndex()) { assert(0 && "InitProcess(): Failed to initalize parse context"); return false; } InitThread(); return true; }
bool InitializePoolIndex() { // Allocate a TLS index. if ((PoolIndex = OS_AllocTLSIndex()) == OS_INVALID_TLS_INDEX) return false; return true; }
bool InitializeParseContextIndex() { if (GlobalParseContextIndex != OS_INVALID_TLS_INDEX) { assert(0 && "InitializeParseContextIndex(): Parse Context already initalised"); return false; } // // Allocate a TLS index. // GlobalParseContextIndex = OS_AllocTLSIndex(); if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) { assert(0 && "InitializeParseContextIndex(): Parse Context already initalised"); return false; } return true; }