Changed Font's mutex to become a static mutex shared between all instances of Font.

This ensures single threaded access of the freetype plugin.
This commit is contained in:
Robert Osfield
2007-09-01 15:24:22 +00:00
parent 13faad13e8
commit 3304646c4c
4 changed files with 12 additions and 10 deletions

View File

@@ -30,6 +30,12 @@ static osg::ApplicationUsageProxy Font_e0(osg::ApplicationUsage::ENVIRONMENTAL_V
static OpenThreads::Mutex s_FontFileMutex;
Font::FontMutex* osgText::Font::getSerializeFontCallsMutex()
{
static OpenThreads::Mutex s_FontCallsMutex;
return &s_FontCallsMutex;
}
std::string osgText::findFontFile(const std::string& str)
{
// try looking in OSGFILEPATH etc first for fonts.

View File

@@ -464,7 +464,7 @@ void Text::computeGlyphRepresentation()
return;
}
OpenThreads::ScopedLock<Font::FontMutex> lock(*(activefont->getSerializeFontCallsMutex()));
OpenThreads::ScopedLock<Font::FontMutex> lock(*(Font::getSerializeFontCallsMutex()));
// initialize bounding box, it will be expanded during glyph position calculation
_textBB.init();