Improved the filtering of changes to master file to prevent using reading from

files that are still under going changes.
This commit is contained in:
Robert Osfield
2007-07-19 17:02:37 +00:00
parent e8eec312a1
commit 1ed0e0a861

View File

@@ -174,9 +174,29 @@ public:
virtual void operator () (osg::Object* object)
{
// osg::notify(osg::NOTICE)<<"void operator ()"<<std::endl;
Files filesA;
Files filesB;
readMasterFile(filesB);
// osg::notify(osg::NOTICE)<<"First read "<<filesA.size()<<std::endl;
// itererate until the master file is stable
do
{
usleep(100000);
filesB.swap(filesA);
filesB.clear();
readMasterFile(filesB);
// osg::notify(osg::NOTICE)<<"second read "<<filesB.size()<<std::endl;
} while (filesA!=filesB);
Files files;
readMasterFile(files);
files.swap(filesB);
// osg::notify(osg::NOTICE)<<"Now equal "<<files.size()<<std::endl;
// osg::notify(osg::NOTICE)<<"void operator () files.size()="<<files.size()<<std::endl;