diff --git a/src/osgPlugins/osg/StateSet.cpp b/src/osgPlugins/osg/StateSet.cpp index 0dfd8a3b5..8ac5005a0 100644 --- a/src/osgPlugins/osg/StateSet.cpp +++ b/src/osgPlugins/osg/StateSet.cpp @@ -7,6 +7,9 @@ #include #include +#include +#include + #include #include @@ -65,6 +68,11 @@ void initGLNames() { static bool first_time = true; if (!first_time) return; + + static OpenThreads::Mutex s_initGLNames; + OpenThreads::ScopedLock lock(s_initGLNames); + + if (!first_time) return; ADD_NAME("GL_ALPHA_TEST",GL_ALPHA_TEST) ADD_NAME("GL_BLEND",GL_BLEND)