Isle
Loading...
Searching...
No Matches
mxsemaphore.h
Go to the documentation of this file.
1#ifndef MXSEMAPHORE_H
2#define MXSEMAPHORE_H
3
4#include "mxtypes.h"
5
6#include <windows.h>
7
8// VTABLE: LEGO1 0x100dccf0
9// SIZE 0x08
10
16public:
21
26 ~MxSemaphore() { CloseHandle(m_hSemaphore); }
27
35 virtual MxResult Init(MxU32 p_initialCount, MxU32 p_maxCount);
36
42 void Wait(MxU32 p_timeoutMS);
43
49 void Release(MxU32 p_releaseCount);
50
51private:
52 HANDLE m_hSemaphore;
53};
54
55#endif // MXSEMAPHORE_H
Implements a lightweight wrapper for Windows semaphores, allowing safe synchronization between thread...
Definition: mxsemaphore.h:15
virtual MxResult Init(MxU32 p_initialCount, MxU32 p_maxCount)
Initializes the semaphore with both initial and maximum counts.
Definition: mxsemaphore.cpp:15
~MxSemaphore()
Destructor, closes the semaphore handle if open.
Definition: mxsemaphore.h:26
MxSemaphore()
Constructs the MxSemaphore object; initializes internal handle to NULL.
Definition: mxsemaphore.cpp:9
void Release(MxU32 p_releaseCount)
Increases the semaphore count, unblocking waiting threads if any.
Definition: mxsemaphore.cpp:33
void Wait(MxU32 p_timeoutMS)
Waits on the semaphore for the specified timeout (in milliseconds).
Definition: mxsemaphore.cpp:27
MxLong MxResult
[AI]
Definition: mxtypes.h:106
unsigned int MxU32
[AI]
Definition: mxtypes.h:32