Replaced use of while(isRunning()) { YieldCurrentThread(); } style loops with use of join() to avoid false positives being reported by valgrind when using the helgrind tool for thread debugging.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14460 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-11-04 10:46:59 +00:00
parent 997ee30039
commit 28a676e105
17 changed files with 195 additions and 233 deletions

View File

@@ -158,17 +158,11 @@ int ImagePager::ImageThread::cancel()
// _databasePagerThreadBlock->release();
// then wait for the the thread to stop running.
while(isRunning())
{
// commenting out debug info as it was cashing crash on exit, presumable
// due to osg::notify or std::cout destructing earlier than this destructor.
// OSG_DEBUG<<"Waiting for DatabasePager to cancel"<<std::endl;
OpenThreads::Thread::YieldCurrentThread();
}
join();
// _startThreadCalled = false;
}
//std::cout<<"DatabasePager::~DatabasePager() stopped running"<<std::endl;
//std::cout<<"ImagePager::cancel() thread stopped running"<<std::endl;
return result;
}