Added mutex lock to iniGLNames to prevent threading problems during initialization
This commit is contained in:
@@ -7,6 +7,9 @@
|
||||
#include <osgDB/Input>
|
||||
#include <osgDB/Output>
|
||||
|
||||
#include <OpenThreads/Mutex>
|
||||
#include <OpenThreads/ScopedLock>
|
||||
|
||||
#include <set>
|
||||
#include <string.h>
|
||||
|
||||
@@ -65,6 +68,11 @@ void initGLNames()
|
||||
{
|
||||
static bool first_time = true;
|
||||
if (!first_time) return;
|
||||
|
||||
static OpenThreads::Mutex s_initGLNames;
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_initGLNames);
|
||||
|
||||
if (!first_time) return;
|
||||
|
||||
ADD_NAME("GL_ALPHA_TEST",GL_ALPHA_TEST)
|
||||
ADD_NAME("GL_BLEND",GL_BLEND)
|
||||
|
||||
Reference in New Issue
Block a user