Protect the _programSet in Shader with a mutex.

This prevents thread safety issues when Shader objects are used in
multiple programs.
This commit is contained in:
Jason Beverage
2018-09-04 10:35:38 -04:00
committed by Robert Osfield
parent a06fcbe5d9
commit 6ae1139630
2 changed files with 4 additions and 0 deletions

View File

@@ -306,6 +306,7 @@ class OSG_EXPORT Shader : public osg::Object
/** osg::Programs that this osg::Shader is attached to */
typedef std::set< osg::Program* > ProgramSet;
ProgramSet _programSet;
OpenThreads::Mutex _programSetMutex;
mutable osg::buffered_value< osg::ref_ptr<ShaderObjects> > _pcsList;
private: