mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
Replaced Common::CriticalSection with a std::mutex implementation. 64bit Windows builds now use SRWLocks and ConditionVariables(requires Vista/7, x64 builds will no longer work on Windows XP x64). Tell me if you hate that. Removed Common::EventEx. Common::Event now uses a std::condition_variable impl.(using ConditionVariables on Windows x64, Events on x86, or posix condition variables elsewhere). I experience slight speed improvements with these changes.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7294 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -36,9 +36,8 @@ void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
||||
|
||||
LogManager *LogManager::m_logManager = NULL;
|
||||
|
||||
LogManager::LogManager() {
|
||||
logMutex = new Common::CriticalSection(1);
|
||||
|
||||
LogManager::LogManager()
|
||||
{
|
||||
// create log files
|
||||
m_Log[LogTypes::MASTER_LOG] = new LogContainer("*", "Master Log");
|
||||
m_Log[LogTypes::BOOT] = new LogContainer("BOOT", "Boot");
|
||||
@ -105,7 +104,6 @@ LogManager::~LogManager() {
|
||||
|
||||
delete m_fileLog;
|
||||
delete m_consoleLog;
|
||||
delete logMutex;
|
||||
}
|
||||
|
||||
void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
||||
@ -127,15 +125,14 @@ void LogManager::Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
|
||||
file, line, level_to_char[(int)level],
|
||||
log->getShortName(), temp);
|
||||
|
||||
logMutex->Enter();
|
||||
std::lock_guard<std::mutex> lk(logMutex);
|
||||
log->trigger(level, msg);
|
||||
logMutex->Leave();
|
||||
}
|
||||
|
||||
void LogManager::removeListener(LogTypes::LOG_TYPE type, LogListener *listener) {
|
||||
logMutex->Enter();
|
||||
void LogManager::removeListener(LogTypes::LOG_TYPE type, LogListener *listener)
|
||||
{
|
||||
std::lock_guard<std::mutex> lk(logMutex);
|
||||
m_Log[type]->removeListener(listener);
|
||||
logMutex->Leave();
|
||||
}
|
||||
|
||||
void LogManager::Init()
|
||||
|
Reference in New Issue
Block a user