From 773fbd1b16bd71d95cc6e32aca25ebbe2020fa87 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 7 Jan 2007 10:00:50 +0000 Subject: [PATCH] Added setThreadSafeRefUnref to LightSource --- include/osg/LightSource | 3 +++ src/osg/LightSource.cpp | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/include/osg/LightSource b/include/osg/LightSource index fccaf1db4..166876039 100644 --- a/include/osg/LightSource +++ b/include/osg/LightSource @@ -73,6 +73,9 @@ class OSG_EXPORT LightSource : public Group /** Set up the local StateSet. */ void setLocalStateSetModes(StateAttribute::GLModeValue value = StateAttribute::ON); + /** Set whether to use a mutex to ensure ref() and unref() are thread safe.*/ + virtual void setThreadSafeRefUnref(bool threadSafe); + virtual BoundingSphere computeBound() const; protected: diff --git a/src/osg/LightSource.cpp b/src/osg/LightSource.cpp index bfcaf6b0c..451acab20 100644 --- a/src/osg/LightSource.cpp +++ b/src/osg/LightSource.cpp @@ -73,3 +73,10 @@ BoundingSphere LightSource::computeBound() const return bsphere; } + +void LightSource::setThreadSafeRefUnref(bool threadSafe) +{ + Group::setThreadSafeRefUnref(threadSafe); + + if (_light.valid()) _light->setThreadSafeRefUnref(threadSafe); +}