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:
John Kessenich
2013-07-08 19:39:16 +00:00
parent 5f1a0b7998
commit 7213324259
59 changed files with 18949 additions and 4503 deletions

View File

@@ -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;