Reframe the preprocessor as a C++ class, with instances, removing all C code, removing all global variables. Upgrade bison version to pass a parse context on through to the preprocessor. All the basic things to make something thread safe.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22291 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
|
||||
#include "InitializeDll.h"
|
||||
#include "Include/InitializeGlobals.h"
|
||||
#include "Include/InitializeParseContext.h"
|
||||
|
||||
#include "Public/ShaderLang.h"
|
||||
|
||||
@@ -58,18 +57,13 @@ bool InitProcess()
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (!InitializePoolIndex()) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -89,10 +83,7 @@ bool InitThread()
|
||||
|
||||
InitializeGlobalPools();
|
||||
|
||||
if (!InitializeThreadParseContext())
|
||||
return false;
|
||||
|
||||
if (!OS_SetTLSValue(ThreadInitializeIndex, (void *)1)) {
|
||||
if (! OS_SetTLSValue(ThreadInitializeIndex, (void *)1)) {
|
||||
assert(0 && "InitThread(): Unable to set init flag.");
|
||||
return false;
|
||||
}
|
||||
@@ -119,8 +110,6 @@ bool DetachThread()
|
||||
|
||||
FreeGlobalPools();
|
||||
|
||||
if (!FreeParseContext())
|
||||
success = false;
|
||||
}
|
||||
|
||||
return success;
|
||||
@@ -139,9 +128,6 @@ bool DetachProcess()
|
||||
|
||||
FreePoolIndex();
|
||||
|
||||
if (!FreeParseContextIndex())
|
||||
success = false;
|
||||
|
||||
OS_FreeTLSIndex(ThreadInitializeIndex);
|
||||
ThreadInitializeIndex = OS_INVALID_TLS_INDEX;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user