mirror of
https://github.com/SpeedBreakerProject/speedbreaker.git
synced 2026-10-17 21:01:26 +02:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
34 lines
500 B
C++
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
|