From c6ba70e3ada42d4a825502a60d1b4fbc8e861166 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 1 Jul 2008 09:40:06 +0000 Subject: [PATCH] From Mathias Froehlich, "It appears not to be sufficient to set a cmake variable to get a define in such a config file. Instead set that variable to 1. Also included a small compile fix, that appears to be required than ..." --- CMakeModules/CheckAtomicOps.cmake | 2 +- src/osg/Referenced.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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;