Removed redundent Referenced::s/getThreadSafeReferenceCounting() and associated static and env vars as there are now inapprorpiate and no longer supported
This commit is contained in:
@@ -117,12 +117,6 @@ class OSG_EXPORT Referenced
|
||||
|
||||
public:
|
||||
|
||||
/** Set whether reference counting should use a mutex for thread safe reference counting.*/
|
||||
static void setThreadSafeReferenceCounting(bool enableThreadSafeReferenceCounting);
|
||||
|
||||
/** Get whether reference counting is active.*/
|
||||
static bool getThreadSafeReferenceCounting();
|
||||
|
||||
friend class DeleteHandler;
|
||||
|
||||
/** Set a DeleteHandler to which deletion of all referenced counted objects
|
||||
|
||||
@@ -427,15 +427,6 @@ SET(TARGET_SRC
|
||||
${OPENSCENEGRAPH_VERSIONINFO_RC}
|
||||
)
|
||||
|
||||
################################################################################
|
||||
## Quieten warnings that a due to optional code paths
|
||||
|
||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# Remove -Wextra flag as it barfs on ffmoeg headers
|
||||
STRING(REGEX REPLACE "-Wextra" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
ENDIF()
|
||||
|
||||
|
||||
|
||||
SET(TARGET_LIBRARIES OpenThreads)
|
||||
|
||||
|
||||
@@ -97,32 +97,9 @@ struct InitGlobalMutexes
|
||||
};
|
||||
static InitGlobalMutexes s_initGlobalMutexes;
|
||||
|
||||
|
||||
#if !defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS)
|
||||
static bool s_useThreadSafeReferenceCounting = getenv("OSG_THREAD_SAFE_REF_UNREF")!=0;
|
||||
#endif
|
||||
// static std::auto_ptr<DeleteHandler> s_deleteHandler(0);
|
||||
static DeleteHandlerPointer s_deleteHandler(0);
|
||||
|
||||
static ApplicationUsageProxy Referenced_e0(ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_THREAD_SAFE_REF_UNREF","");
|
||||
|
||||
void Referenced::setThreadSafeReferenceCounting(bool enableThreadSafeReferenceCounting)
|
||||
{
|
||||
#if !defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS)
|
||||
s_useThreadSafeReferenceCounting = enableThreadSafeReferenceCounting;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool Referenced::getThreadSafeReferenceCounting()
|
||||
{
|
||||
#if defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS)
|
||||
return true;
|
||||
#else
|
||||
return s_useThreadSafeReferenceCounting;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void Referenced::setDeleteHandler(DeleteHandler* handler)
|
||||
{
|
||||
s_deleteHandler.reset(handler);
|
||||
@@ -153,10 +130,7 @@ Referenced::Referenced():
|
||||
#endif
|
||||
{
|
||||
#if !defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS)
|
||||
#ifndef ENFORCE_THREADSAFE
|
||||
if (s_useThreadSafeReferenceCounting)
|
||||
#endif
|
||||
_refMutex = new OpenThreads::Mutex;
|
||||
_refMutex = new OpenThreads::Mutex;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_OBJECT_ALLOCATION_DESTRUCTION
|
||||
@@ -206,10 +180,7 @@ Referenced::Referenced(const Referenced&):
|
||||
#endif
|
||||
{
|
||||
#if !defined(_OSG_REFERENCED_USE_ATOMIC_OPERATIONS)
|
||||
#ifndef ENFORCE_THREADSAFE
|
||||
if (s_useThreadSafeReferenceCounting)
|
||||
#endif
|
||||
_refMutex = new OpenThreads::Mutex;
|
||||
_refMutex = new OpenThreads::Mutex;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_OBJECT_ALLOCATION_DESTRUCTION
|
||||
|
||||
@@ -307,9 +307,6 @@ void ViewerBase::startThreading()
|
||||
return;
|
||||
}
|
||||
|
||||
// using multi-threading so make sure that new objects are allocated with thread safe ref/unref
|
||||
osg::Referenced::setThreadSafeReferenceCounting(true);
|
||||
|
||||
Scenes scenes;
|
||||
getScenes(scenes);
|
||||
for(Scenes::iterator scitr = scenes.begin();
|
||||
|
||||
Reference in New Issue
Block a user