From e19f23021f76a7e9b7fbe195af5e2f2a6c2b241e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 15 Sep 2007 17:40:08 +0000 Subject: [PATCH] Introduced the use of a ReentrantMutex to avoid problems with findFontFile. --- src/osgText/Font.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/osgText/Font.cpp b/src/osgText/Font.cpp index 0a9fbfc32..90b012a47 100644 --- a/src/osgText/Font.cpp +++ b/src/osgText/Font.cpp @@ -23,12 +23,14 @@ #include #include +#include + using namespace osgText; using namespace std; static osg::ApplicationUsageProxy Font_e0(osg::ApplicationUsage::ENVIRONMENTAL_VARIABLE,"OSG_TEXT_INCREMENTAL_SUBLOADING ","ON | OFF"); -static OpenThreads::Mutex s_FontFileMutex; +static OpenThreads::ReentrantMutex s_FontFileMutex; Font::FontMutex* osgText::Font::getSerializeFontCallsMutex() { @@ -42,7 +44,7 @@ std::string osgText::findFontFile(const std::string& str) std::string filename = osgDB::findDataFile(str); if (!filename.empty()) return filename; - OpenThreads::ScopedLock lock(s_FontFileMutex); + OpenThreads::ScopedLock lock(s_FontFileMutex); static osgDB::FilePathList s_FontFilePath; static bool initialized = false;