isle-portable/LEGO1/omni/include/mxcriticalsection.h

26 lines
581 B
C
Raw Normal View History

2023-06-12 14:46:44 -04:00
#ifndef MXCRITICALSECTION_H
#define MXCRITICALSECTION_H
#include <SDL3/SDL_mutex.h>
2023-06-12 14:46:44 -04:00
2023-11-28 08:26:39 -05:00
// SIZE 0x1c
2023-10-24 19:38:27 -04:00
class MxCriticalSection {
2023-06-12 14:46:44 -04:00
public:
MxCriticalSection();
~MxCriticalSection();
static void SetDoMutex();
2023-10-24 19:38:27 -04:00
void Enter();
void Leave();
2023-06-12 14:46:44 -04:00
private:
// [library:synchronization]
// SDL uses the most efficient mutex implementation available on the target platform.
// Originally this class allowed working with either a Win32 CriticalSection or Mutex,
// but only CriticalSection was ever used and we don't need both anyway.
SDL_Mutex* m_mutex;
2023-06-12 14:46:44 -04:00
};
#endif // MXCRITICALSECTION_H