2023-07-07 14:00:48 -04:00
|
|
|
#ifndef MX_SEMAPHORE_H
|
|
|
|
#define MX_SEMAPHORE_H
|
|
|
|
|
|
|
|
#include "mxtypes.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
|
2023-07-07 14:00:48 -04:00
|
|
|
#include <windows.h>
|
|
|
|
|
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
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
// Inlined only, no offset
|
|
|
|
~MxSemaphore() { CloseHandle(m_hSemaphore); }
|
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
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
void Wait(MxU32 p_timeoutMS);
|
|
|
|
void Release(MxU32 p_releaseCount);
|
2023-07-07 14:00:48 -04:00
|
|
|
|
|
|
|
private:
|
2023-12-25 13:32:01 -05:00
|
|
|
HANDLE m_hSemaphore; // 0x04
|
2023-07-07 14:00:48 -04:00
|
|
|
};
|
|
|
|
|
2023-10-25 14:51:59 -04:00
|
|
|
#endif // MX_SEMAPHORE_H
|