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
|
|
|
|
2024-05-30 16:56:44 -04:00
|
|
|
#include <SDL3/SDL_thread.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
|
|
|
|
2024-07-04 19:06:32 -04:00
|
|
|
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:
|
2024-06-24 10:25:51 -04:00
|
|
|
static int SDLCALL ThreadProc(void* p_thread);
|
2023-07-07 14:00:48 -04:00
|
|
|
|
2024-05-30 16:56:44 -04:00
|
|
|
SDL_Thread* m_thread;
|
2024-05-31 23:13:27 -04:00
|
|
|
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-07-12 17:12:03 -04:00
|
|
|
#endif // MXTHREAD_H
|