Merged from svn/trunk fix to initGLNames() which addressed thread safety issue

This commit is contained in:
Robert Osfield
2009-06-22 07:42:57 +00:00
parent 102e5c2439
commit a9c1dd1a4a

View File

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