Files
2026-10-08 13:25:54 +00:00

34 lines
500 B
C++

// Adapted from Unleashed Recompiled (https://github.com/hedge-dev/UnleashedRecomp),
// GPL-3.0-or-later. Modified for SpeedBreaker.
#pragma once
#ifdef _WIN32
struct Mutex : CRITICAL_SECTION
{
Mutex()
{
InitializeCriticalSection(this);
}
~Mutex()
{
DeleteCriticalSection(this);
}
void lock()
{
EnterCriticalSection(this);
}
void unlock()
{
LeaveCriticalSection(this);
}
};
#else
using Mutex = std::mutex;
#endif