diff --git a/include/osg/Referenced b/include/osg/Referenced index c807c295e..0a683232f 100644 --- a/include/osg/Referenced +++ b/include/osg/Referenced @@ -47,18 +47,17 @@ class OSG_EXPORT Referenced Referenced(); - /// deprecated, Referenced is now always uses thread safe ref/unref, use default Refernced() constructor instead + /** Deprecated, Referenced is now always uses thread safe ref/unref, use default Refernced() constructor instead */ explicit Referenced(bool threadSafeRefUnref); Referenced(const Referenced&); inline Referenced& operator = (const Referenced&) { return *this; } - /** Set whether to use a mutex to ensure ref() and unref() are thread safe.*/ - virtual void setThreadSafeRefUnref(bool threadSafe); + /** Deprecated, Referenced is always theadsafe so there method now has no effect and does not need to be called.*/ + virtual void setThreadSafeRefUnref(bool /*threadSafe*/) {} /** Get whether a mutex is used to ensure ref() and unref() are thread safe.*/ - #if defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS) bool getThreadSafeRefUnref() const { return true; } #else diff --git a/src/osg/Referenced.cpp b/src/osg/Referenced.cpp index 11d4601c7..95b665c57 100644 --- a/src/osg/Referenced.cpp +++ b/src/osg/Referenced.cpp @@ -293,31 +293,6 @@ void Referenced::signalObserversAndDelete(bool signalDelete, bool doDelete) cons } } - -void Referenced::setThreadSafeRefUnref(bool threadSafe) -{ -#if !defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS) - if (threadSafe) - { - if (!_refMutex) - { - // we want thread safe ref()/unref() so assign a mutex - _refMutex = new OpenThreads::Mutex; - } - } - else - { - if (_refMutex) - { - // we don't want thread safe ref()/unref() so remove any assigned mutex - OpenThreads::Mutex* tmpMutexPtr = _refMutex; - _refMutex = 0; - delete tmpMutexPtr; - } - } -#endif -} - int Referenced::unref_nodelete() const { #if defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS)