diff --git a/include/osg/CameraNode b/include/osg/CameraNode index 0769ac5b6..63a4566f6 100644 --- a/include/osg/CameraNode +++ b/include/osg/CameraNode @@ -305,7 +305,7 @@ class OSG_EXPORT CameraNode : public Transform, public CullSettings /** Get the const post draw callback.*/ const DrawCallback* getPostDrawCallback() const { return _postDrawCallback.get(); } - OpenThreads::Mutex& getDataChangeMutex() const { return _dataChangeMutex; } + OpenThreads::Mutex* getDataChangeMutex() const { return &_dataChangeMutex; } public: diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp index 6c630d113..23e524182 100644 --- a/src/osgUtil/CullVisitor.cpp +++ b/src/osgUtil/CullVisitor.cpp @@ -1104,7 +1104,7 @@ void CullVisitor::apply(osg::CameraNode& camera) osg::ref_ptr rtts = dynamic_cast(camera.getRenderingCache(contextID)); if (!rtts) { - OpenThreads::ScopedLock lock(camera.getDataChangeMutex()); + OpenThreads::ScopedLock lock(*(camera.getDataChangeMutex())); rtts = new osgUtil::RenderStage; rtts->setCameraNode(&camera); diff --git a/src/osgUtil/RenderStage.cpp b/src/osgUtil/RenderStage.cpp index d2d65b385..b3cb949c3 100644 --- a/src/osgUtil/RenderStage.cpp +++ b/src/osgUtil/RenderStage.cpp @@ -286,7 +286,7 @@ void RenderStage::runCameraSetUp(osg::State& state) { osg::notify(osg::INFO)<<"Setting up osg::CameraNode::FRAME_BUFFER_OBJECT"< lock(_camera->getDataChangeMutex()); + OpenThreads::ScopedLock lock(*(_camera->getDataChangeMutex())); _fbo = new osg::FrameBufferObject; diff --git a/src/osgWrappers/osg/CameraNode.cpp b/src/osgWrappers/osg/CameraNode.cpp index 443fc1444..4cb330ade 100644 --- a/src/osgWrappers/osg/CameraNode.cpp +++ b/src/osgWrappers/osg/CameraNode.cpp @@ -135,14 +135,14 @@ BEGIN_OBJECT_REFLECTOR(osg::CameraNode) I_Method1(void, setPostDrawCallback, IN, osg::CameraNode::DrawCallback *, cb); I_Method0(osg::CameraNode::DrawCallback *, getPostDrawCallback); I_Method0(const osg::CameraNode::DrawCallback *, getPostDrawCallback); - I_Method0(OpenThreads::Mutex &, getDataChangeMutex); + I_Method0(OpenThreads::Mutex *, getDataChangeMutex); I_Method2(bool, computeLocalToWorldMatrix, IN, osg::Matrix &, matrix, IN, osg::NodeVisitor *, x); I_Method2(bool, computeWorldToLocalMatrix, IN, osg::Matrix &, matrix, IN, osg::NodeVisitor *, x); I_ReadOnlyProperty(osg::CameraNode::BufferAttachmentMap &, BufferAttachmentMap); I_Property(const osg::Vec4 &, ClearColor); I_Property(GLbitfield, ClearMask); I_Property(osg::ColorMask *, ColorMask); - I_ReadOnlyProperty(OpenThreads::Mutex &, DataChangeMutex); + I_ReadOnlyProperty(OpenThreads::Mutex *, DataChangeMutex); I_Property(GLenum, DrawBuffer); I_Property(osg::GraphicsContext *, GraphicsContext); I_ReadOnlyProperty(osg::Matrixd, InverseViewMatrix);