2023-07-07 14:00:48 -04:00
|
|
|
#ifndef MXTHREAD_H
|
|
|
|
#define MXTHREAD_H
|
|
|
|
|
2023-07-12 17:12:03 -04:00
|
|
|
#include "compat.h"
|
2023-07-07 14:00:48 -04:00
|
|
|
#include "mxsemaphore.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
#include "mxtypes.h"
|
2023-07-07 14:00:48 -04:00
|
|
|
|
|
|
|
class MxCore;
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100dc860
|
2023-12-25 13:32:01 -05:00
|
|
|
// SIZE 0x1c
|
2023-10-24 19:38:27 -04:00
|
|
|
class MxThread {
|
2023-07-07 14:00:48 -04:00
|
|
|
public:
|
2023-10-24 19:38:27 -04:00
|
|
|
// Note: Comes before virtual destructor
|
|
|
|
virtual MxResult Run();
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2023-12-13 05:48:14 -05:00
|
|
|
MxResult Start(MxS32 p_stack, MxS32 p_flag);
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
void Terminate();
|
|
|
|
void Sleep(MxS32 p_milliseconds);
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
inline MxBool IsRunning() { return m_running; }
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x100bf580
|
|
|
|
// MxThread::`scalar deleting destructor'
|
|
|
|
|
2023-07-07 14:00:48 -04:00
|
|
|
protected:
|
2023-10-24 19:38:27 -04:00
|
|
|
MxThread();
|
2023-10-05 03:47:37 -04:00
|
|
|
|
|
|
|
public:
|
2023-10-24 19:38:27 -04:00
|
|
|
virtual ~MxThread();
|
2023-07-07 14:00:48 -04:00
|
|
|
|
|
|
|
private:
|
2023-10-24 19:38:27 -04:00
|
|
|
static unsigned ThreadProc(void* p_thread);
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2023-12-25 13:32:01 -05:00
|
|
|
MxULong m_hThread; // 0x04
|
|
|
|
MxU32 m_threadId; // 0x08
|
|
|
|
MxBool m_running; // 0x0c
|
|
|
|
MxSemaphore m_semaphore; // 0x10
|
2023-10-29 10:01:14 -04:00
|
|
|
|
|
|
|
protected:
|
2023-12-25 13:32:01 -05:00
|
|
|
MxCore* m_target; // 0x18
|
2023-07-07 14:00:48 -04:00
|
|
|
};
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100dc6d8
|
2023-12-25 13:32:01 -05:00
|
|
|
// SIZE 0x20
|
2023-10-24 19:38:27 -04:00
|
|
|
class MxTickleThread : public MxThread {
|
2023-07-07 14:00:48 -04:00
|
|
|
public:
|
2023-12-13 05:48:14 -05:00
|
|
|
MxTickleThread(MxCore* p_target, MxS32 p_frequencyMS);
|
2023-10-24 19:38:27 -04:00
|
|
|
virtual ~MxTickleThread() {}
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
MxResult Run() override;
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x100b8c20
|
|
|
|
// MxTickleThread::`scalar deleting destructor'
|
|
|
|
|
2023-07-07 14:00:48 -04:00
|
|
|
private:
|
2023-12-25 13:32:01 -05:00
|
|
|
MxS32 m_frequencyMS; // 0x1c
|
2023-07-07 14:00:48 -04:00
|
|
|
};
|
|
|
|
|
2023-07-12 17:12:03 -04:00
|
|
|
#endif // MXTHREAD_H
|