Added mutex to serialize access to the trpager

This commit is contained in:
Robert Osfield
2008-06-16 13:20:51 +00:00
parent 68e750626a
commit f10cb3c388
2 changed files with 8 additions and 0 deletions

View File

@@ -90,6 +90,8 @@ void TXPNode::traverse(osg::NodeVisitor& nv)
{
case osg::NodeVisitor::CULL_VISITOR:
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
osgUtil::CullVisitor* cv = dynamic_cast<osgUtil::CullVisitor*>(&nv);
if (cv)
@@ -132,8 +134,12 @@ void TXPNode::traverse(osg::NodeVisitor& nv)
break;
}
case osg::NodeVisitor::UPDATE_VISITOR:
{
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
updateSceneGraph();
break;
}
default:
break;
}

View File

@@ -93,6 +93,8 @@ protected:
std::string _archiveName;
std::string _options;
OpenThreads::Mutex _mutex;
osg::ref_ptr<TXPArchive> _archive;
osg::ref_ptr<TXPPageManager> _pageManager;