From 3b65b028b260fa11988297bb4248076a3b4fea8b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 9 Oct 2003 09:48:36 +0000 Subject: [PATCH] Added protection to the DatabasePager::requestNodeFile()'s call to startThread to ensure that only one startThread is every issued. --- src/osgDB/DatabasePager.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index 2f4eb7c94..4b1067fe8 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -5,6 +5,8 @@ #include #include +#include + #ifdef WIN32 #include #else @@ -111,12 +113,22 @@ void DatabasePager::requestNodeFile(const std::string& fileName,osg::Group* grou _fileRequestListMutex.unlock(); } - //if (!threadIsRunning()) if (!isRunning()) { - osg::notify(osg::DEBUG_INFO)<<"DatabasePager::startThread()"< lock(s_mutex); + + static bool s_startThreadCalled = false; + + if (!s_startThreadCalled) + { + s_startThreadCalled = true; + osg::notify(osg::DEBUG_INFO)<<"DatabasePager::startThread()"<