mirror of
https://github.com/cathery/sys-con.git
synced 2024-07-05 02:38:45 +00:00
log: use scoped lock mutexes
This commit is contained in:
parent
9f437adca5
commit
f9054f9d67
|
@ -3,11 +3,11 @@
|
||||||
#include "configFile.h"
|
#include "configFile.h"
|
||||||
#include <stratosphere.hpp>
|
#include <stratosphere.hpp>
|
||||||
|
|
||||||
static Mutex g_PrintMutex = 0;
|
static ams::os::Mutex printMutex;
|
||||||
|
|
||||||
void WriteToLog(const char *fmt, ...)
|
void WriteToLog(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
mutexLock(&g_PrintMutex);
|
std::scoped_lock printLock(printMutex);
|
||||||
|
|
||||||
u64 ts;
|
u64 ts;
|
||||||
TimeCalendarTime caltime;
|
TimeCalendarTime caltime;
|
||||||
|
@ -27,13 +27,10 @@ void WriteToLog(const char *fmt, ...)
|
||||||
|
|
||||||
fprintf(fp, "\n");
|
fprintf(fp, "\n");
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
mutexUnlock(&g_PrintMutex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LockedUpdateConsole()
|
void LockedUpdateConsole()
|
||||||
{
|
{
|
||||||
mutexLock(&g_PrintMutex);
|
std::scoped_lock printLock(printMutex);
|
||||||
consoleUpdate(NULL);
|
consoleUpdate(NULL);
|
||||||
mutexUnlock(&g_PrintMutex);
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user