From: Tim Moore Date: Sun, 29 Nov 2009 21:54:02 +0000 (+0100) Subject: take locks out of ModelRegistry X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e37c218c2ac71aa40df21b789315a0f2f4eace87;p=simgear.git take locks out of ModelRegistry They should be unnecessary and were causing deadlock with Effects that load images. --- diff --git a/simgear/scene/model/ModelRegistry.cxx b/simgear/scene/model/ModelRegistry.cxx index 8a13c762..2bf8c878 100644 --- a/simgear/scene/model/ModelRegistry.cxx +++ b/simgear/scene/model/ModelRegistry.cxx @@ -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 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 lock(readerMutex); - ReaderWriter::ReadResult res; CallbackMap::iterator iter = nodeCallbackMap.find(getFileExtension(fileName)); diff --git a/simgear/scene/model/ModelRegistry.hxx b/simgear/scene/model/ModelRegistry.hxx index 00963151..94931bca 100644 --- a/simgear/scene/model/ModelRegistry.hxx +++ b/simgear/scene/model/ModelRegistry.hxx @@ -19,8 +19,6 @@ #ifndef _SG_MODELREGISTRY_HXX #define _SG_MODELREGISTRY_HXX 1 -#include - #include #include #include @@ -225,9 +223,6 @@ protected: CallbackMap imageCallbackMap; CallbackMap nodeCallbackMap; osg::ref_ptr _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