21 CloseHandle((HANDLE) m_hThread);
34 _beginthreadex(
NULL, p_stackSize * 4, (
ThreadFunc) &MxThread::ThreadProc,
this, p_flag, &m_threadId)
53 m_semaphore.
Wait(INFINITE);
57unsigned MxThread::ThreadProc(
void* p_thread)
virtual MxResult Init(MxU32 p_initialCount, MxU32 p_maxCount)
Initializes the semaphore with both initial and maximum counts.
void Release(MxU32 p_releaseCount)
Increases the semaphore count, unblocking waiting threads if any.
void Wait(MxU32 p_timeoutMS)
Waits on the semaphore for the specified timeout (in milliseconds).
[AI] Abstract thread class providing a platform-independent interface for thread management.
virtual ~MxThread()
[AI] Virtual destructor for MxThread.
void Terminate()
[AI] Signals the thread to terminate.
virtual MxResult Run()
[AI] Virtual function executed when the thread runs.
MxResult Start(MxS32 p_stackSize, MxS32 p_flag)
[AI] Starts the thread with a given stack size and creation flags.
void Sleep(MxS32 p_milliseconds)
[AI] Sleeps the current thread for the given duration in milliseconds.
#define DECOMP_SIZE_ASSERT(T, S)
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
unsigned(__stdcall * ThreadFunc)(void *)