]> git.mxchange.org Git - simgear.git/commitdiff
take locks out of ModelRegistry
authorTim Moore <timoore@redhat.com>
Sun, 29 Nov 2009 21:54:02 +0000 (22:54 +0100)
committerTim Moore <timoore@redhat.com>
Sun, 29 Nov 2009 21:54:02 +0000 (22:54 +0100)
They should be unnecessary and were causing deadlock with Effects that
load images.

simgear/scene/model/ModelRegistry.cxx
simgear/scene/model/ModelRegistry.hxx

index 8a13c7624b2c86ec0dfa5614f6975634504691bb..2bf8c878e0fa9c9b362a174fb3b3426147492c6d 100644 (file)
@@ -62,9 +62,6 @@ using namespace osgUtil;
 using namespace osgDB;
 using namespace simgear;
 
-using OpenThreads::ReentrantMutex;
-using OpenThreads::ScopedLock;
-
 // Little helper class that holds an extra reference to a
 // loaded 3d model.
 // Since we clone all structural nodes from our 3d models,
@@ -205,7 +202,6 @@ ReaderWriter::ReadResult
 ModelRegistry::readImage(const string& fileName,
                          const ReaderWriter::Options* opt)
 {
-    ScopedLock<ReentrantMutex> lock(readerMutex);
     CallbackMap::iterator iter
         = imageCallbackMap.find(getFileExtension(fileName));
     {
@@ -354,8 +350,6 @@ ReaderWriter::ReadResult
 ModelRegistry::readNode(const string& fileName,
                         const ReaderWriter::Options* opt)
 {
-    ScopedLock<ReentrantMutex> lock(readerMutex);
-
     ReaderWriter::ReadResult res;
     CallbackMap::iterator iter
         = nodeCallbackMap.find(getFileExtension(fileName));
index 0096315156c6cbdbd3e9c21033539aa82f874a03..94931bca1e287674f2653111efc2dea772d3a285 100644 (file)
@@ -19,8 +19,6 @@
 #ifndef _SG_MODELREGISTRY_HXX
 #define _SG_MODELREGISTRY_HXX 1
 
-#include <OpenThreads/ReentrantMutex>
-
 #include <osg/ref_ptr>
 #include <osg/Node>
 #include <osgDB/FileUtils>
@@ -225,9 +223,6 @@ protected:
     CallbackMap imageCallbackMap;
     CallbackMap nodeCallbackMap;
     osg::ref_ptr<DefaultCallback> _defaultCallback;
-    // Protect against simultaneous calls from main thread (MP models)
-    // and pager thread.
-    OpenThreads::ReentrantMutex readerMutex;
 };
 
 // Callback that only loads the file without any caching or