diff --git a/CMakeModules/CheckAtomicOps.cmake b/CMakeModules/CheckAtomicOps.cmake index 3cd1876d8..773130f37 100644 --- a/CMakeModules/CheckAtomicOps.cmake +++ b/CMakeModules/CheckAtomicOps.cmake @@ -91,5 +91,5 @@ int main(int, const char**) " _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED) IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED) - SET(_OPENTHREADS_ATOMIC_USE_MUTEX) + SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1) ENDIF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED) diff --git a/src/osg/Referenced.cpp b/src/osg/Referenced.cpp index bac3b2c56..7e8fce9aa 100644 --- a/src/osg/Referenced.cpp +++ b/src/osg/Referenced.cpp @@ -82,10 +82,12 @@ struct DeleteHandlerPointer typedef std::set ObserverSet; +#if defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS) struct Referenced::ObserverSetData { OpenThreads::Mutex _mutex; ObserverSet _observers; }; +#endif #if !defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS) static bool s_useThreadSafeReferenceCounting = getenv("OSG_THREAD_SAFE_REF_UNREF")!=0;