2024-05-30 15:03:43 -04:00
|
|
|
#ifndef MXSEMAPHORE_H
|
|
|
|
#define MXSEMAPHORE_H
|
2023-07-07 14:00:48 -04:00
|
|
|
|
|
|
|
#include "mxtypes.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
|
2024-05-30 14:41:20 -04:00
|
|
|
#include <SDL3/SDL_mutex.h>
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2024-01-14 16:28:46 -05:00
|
|
|
// VTABLE: LEGO1 0x100dccf0
|
2023-12-25 13:32:01 -05:00
|
|
|
// SIZE 0x08
|
2023-10-24 19:38:27 -04:00
|
|
|
class MxSemaphore {
|
2023-07-07 14:00:48 -04:00
|
|
|
public:
|
2023-10-24 19:38:27 -04:00
|
|
|
MxSemaphore();
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2024-01-14 16:28:46 -05:00
|
|
|
// FUNCTION: LEGO1 0x100c87e0
|
2024-05-30 14:41:20 -04:00
|
|
|
~MxSemaphore() { SDL_DestroySemaphore(m_semaphore); }
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
virtual MxResult Init(MxU32 p_initialCount, MxU32 p_maxCount);
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2024-05-30 14:41:20 -04:00
|
|
|
void Wait();
|
|
|
|
void Release();
|
2023-07-07 14:00:48 -04:00
|
|
|
|
|
|
|
private:
|
2024-05-30 16:38:42 -04:00
|
|
|
SDL_Semaphore* m_semaphore;
|
2023-07-07 14:00:48 -04:00
|
|
|
};
|
|
|
|
|
2024-05-30 15:03:43 -04:00
|
|
|
#endif // MXSEMAPHORE_H
|