take locks out of ModelRegistry
They should be unnecessary and were causing deadlock with Effects that load images.
This commit is contained in:
@@ -62,9 +62,6 @@ using namespace osgUtil;
|
|||||||
using namespace osgDB;
|
using namespace osgDB;
|
||||||
using namespace simgear;
|
using namespace simgear;
|
||||||
|
|
||||||
using OpenThreads::ReentrantMutex;
|
|
||||||
using OpenThreads::ScopedLock;
|
|
||||||
|
|
||||||
// Little helper class that holds an extra reference to a
|
// Little helper class that holds an extra reference to a
|
||||||
// loaded 3d model.
|
// loaded 3d model.
|
||||||
// Since we clone all structural nodes from our 3d models,
|
// Since we clone all structural nodes from our 3d models,
|
||||||
@@ -205,7 +202,6 @@ ReaderWriter::ReadResult
|
|||||||
ModelRegistry::readImage(const string& fileName,
|
ModelRegistry::readImage(const string& fileName,
|
||||||
const ReaderWriter::Options* opt)
|
const ReaderWriter::Options* opt)
|
||||||
{
|
{
|
||||||
ScopedLock<ReentrantMutex> lock(readerMutex);
|
|
||||||
CallbackMap::iterator iter
|
CallbackMap::iterator iter
|
||||||
= imageCallbackMap.find(getFileExtension(fileName));
|
= imageCallbackMap.find(getFileExtension(fileName));
|
||||||
{
|
{
|
||||||
@@ -354,8 +350,6 @@ ReaderWriter::ReadResult
|
|||||||
ModelRegistry::readNode(const string& fileName,
|
ModelRegistry::readNode(const string& fileName,
|
||||||
const ReaderWriter::Options* opt)
|
const ReaderWriter::Options* opt)
|
||||||
{
|
{
|
||||||
ScopedLock<ReentrantMutex> lock(readerMutex);
|
|
||||||
|
|
||||||
ReaderWriter::ReadResult res;
|
ReaderWriter::ReadResult res;
|
||||||
CallbackMap::iterator iter
|
CallbackMap::iterator iter
|
||||||
= nodeCallbackMap.find(getFileExtension(fileName));
|
= nodeCallbackMap.find(getFileExtension(fileName));
|
||||||
|
|||||||
@@ -19,8 +19,6 @@
|
|||||||
#ifndef _SG_MODELREGISTRY_HXX
|
#ifndef _SG_MODELREGISTRY_HXX
|
||||||
#define _SG_MODELREGISTRY_HXX 1
|
#define _SG_MODELREGISTRY_HXX 1
|
||||||
|
|
||||||
#include <OpenThreads/ReentrantMutex>
|
|
||||||
|
|
||||||
#include <osg/ref_ptr>
|
#include <osg/ref_ptr>
|
||||||
#include <osg/Node>
|
#include <osg/Node>
|
||||||
#include <osgDB/FileUtils>
|
#include <osgDB/FileUtils>
|
||||||
@@ -225,9 +223,6 @@ protected:
|
|||||||
CallbackMap imageCallbackMap;
|
CallbackMap imageCallbackMap;
|
||||||
CallbackMap nodeCallbackMap;
|
CallbackMap nodeCallbackMap;
|
||||||
osg::ref_ptr<DefaultCallback> _defaultCallback;
|
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
|
// Callback that only loads the file without any caching or
|
||||||
|
|||||||
Reference in New Issue
Block a user