Isle
Loading...
Searching...
No Matches
mxthread.h
Go to the documentation of this file.
1#ifndef MXTHREAD_H
2#define MXTHREAD_H
3
4#include "compat.h"
5#include "mxsemaphore.h"
6#include "mxtypes.h"
7
8class MxCore;
9
10// VTABLE: LEGO1 0x100dc860
11// SIZE 0x1c
17class MxThread {
18public:
25 virtual MxResult Run();
26
35 MxResult Start(MxS32 p_stackSize, MxS32 p_flag);
36
42 void Terminate();
43
49 void Sleep(MxS32 p_milliseconds);
50
56 MxBool IsRunning() { return m_running; }
57
58 // SYNTHETIC: LEGO1 0x100bf580
59 // MxThread::`scalar deleting destructor'
60
61protected:
66 MxThread();
67
68public:
73 virtual ~MxThread();
74
75private:
82 static unsigned ThreadProc(void* p_thread);
83
84 MxULong m_hThread;
85 MxU32 m_threadId;
86 MxBool m_running;
87 MxSemaphore m_semaphore;
88
89protected:
91};
92
93#endif // MXTHREAD_H
[AI] Base virtual class for all Mindscape engine (Mx) objects.
Definition: mxcore.h:15
Implements a lightweight wrapper for Windows semaphores, allowing safe synchronization between thread...
Definition: mxsemaphore.h:15
[AI] Abstract thread class providing a platform-independent interface for thread management.
Definition: mxthread.h:17
virtual ~MxThread()
[AI] Virtual destructor for MxThread.
Definition: mxthread.cpp:18
MxCore * m_target
[AI] Pointer to the target object (optional, typically the object being processed by the thread)....
Definition: mxthread.h:90
void Terminate()
[AI] Signals the thread to terminate.
Definition: mxthread.cpp:50
virtual MxResult Run()
[AI] Virtual function executed when the thread runs.
Definition: mxthread.cpp:63
MxResult Start(MxS32 p_stackSize, MxS32 p_flag)
[AI] Starts the thread with a given stack size and creation flags.
Definition: mxthread.cpp:28
void Sleep(MxS32 p_milliseconds)
[AI] Sleeps the current thread for the given duration in milliseconds.
Definition: mxthread.cpp:44
MxThread()
[AI] Protected constructor for MxThread.
Definition: mxthread.cpp:10
MxBool IsRunning()
[AI] Returns whether the thread is currently running.
Definition: mxthread.h:56
MxU8 MxBool
[AI]
Definition: mxtypes.h:124
MxLong MxResult
[AI]
Definition: mxtypes.h:106
signed int MxS32
[AI]
Definition: mxtypes.h:38
unsigned int MxULong
[AI]
Definition: mxtypes.h:93
unsigned int MxU32
[AI]
Definition: mxtypes.h:32