mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Correct the position of a mutex lock in logging
This commit is contained in:
1 parent
ed127188a0
commit
a4b2a6051c
1 file changed
+2
-1
@@ -418,7 +418,6 @@ void LogManager::StdioLog(const LogMessage &message) {
|
||||
__android_log_print(mode, LOG_APP_NAME, "%.*s", (int)msg.size(), msg.data());
|
||||
}
|
||||
#else
|
||||
std::lock_guard<std::mutex> lock(stdioLock_);
|
||||
char text[2048];
|
||||
snprintf(text, sizeof(text), "%s %s %s", message.timestamp, message.header, message.msg.c_str());
|
||||
text[sizeof(text) - 2] = '\n';
|
||||
@@ -449,6 +448,8 @@ void LogManager::StdioLog(const LogMessage &message) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> lock(stdioLock_);
|
||||
fprintf(stderr, "%s%s%s", colorAttr, text, resetAttr);
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user