Fix race condition in Logger::GetLoggers.

Fixes #5341
This commit is contained in:
Gunnar Beutner 2013-12-16 09:53:50 +01:00
parent 9452bc7095
commit 2f58071b6f
1 changed files with 3 additions and 3 deletions

View File

@ -43,19 +43,19 @@ void Logger::Start(void)
{
DynamicObject::Start();
boost::mutex::scoped_lock(m_Mutex);
boost::mutex::scoped_lock lock(m_Mutex);
m_Loggers.insert(GetSelf());
}
void Logger::Stop(void)
{
boost::mutex::scoped_lock(m_Mutex);
boost::mutex::scoped_lock lock(m_Mutex);
m_Loggers.erase(GetSelf());
}
std::set<Logger::Ptr> Logger::GetLoggers(void)
{
boost::mutex::scoped_lock(m_Mutex);
boost::mutex::scoped_lock lock(m_Mutex);
return m_Loggers;
}