Changeset 7331

Show
Ignore:
Timestamp:
08/31/07 20:56:22
Author:
robert
Message:

Added mutex to protect the readFontFile calls

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • OpenSceneGraph/trunk/src/osgText/Font.cpp

    r7289 r7331  
    2929static osg::ApplicationUsageProxy Font_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_TEXT_INCREMENTAL_SUBLOADING <type>","ON | OFF"); 
    3030 
     31static OpenThreads::Mutex s_FontFileMutex; 
    3132 
    3233std::string osgText::findFontFile(const std::string& str) 
     
    3637    if (!filename.empty()) return filename; 
    3738 
     39    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_FontFileMutex); 
    3840 
    3941    static osgDB::FilePathList s_FontFilePath; 
     
    8991    if (foundFile.empty()) return 0; 
    9092     
     93    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_FontFileMutex); 
     94 
    9195    osg::ref_ptr<osgDB::ReaderWriter::Options> localOptions; 
    9296    if (!userOptions) 
     
    109113osgText::Font* osgText::readFontStream(std::istream& stream, const osgDB::ReaderWriter::Options* userOptions) 
    110114{ 
     115    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_FontFileMutex); 
     116 
    111117    osg::ref_ptr<osgDB::ReaderWriter::Options> localOptions; 
    112118    if (!userOptions)