mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
Revert "Add potentially unnecessary threading stuff"
This reverts commit 0787b2ebf8.
This commit is contained in:
parent
5ca0b4ce8d
commit
e4ca44c915
@ -5,11 +5,7 @@
|
||||
#include "mxsemaphore.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
#ifdef PS2
|
||||
#include <kernel.h>
|
||||
#else
|
||||
#include <SDL3/SDL_thread.h>
|
||||
#endif
|
||||
|
||||
class MxCore;
|
||||
|
||||
@ -45,13 +41,9 @@ class MxThread {
|
||||
virtual ~MxThread();
|
||||
|
||||
private:
|
||||
#ifdef PS2
|
||||
static int ThreadProc(void* p_thread);
|
||||
int m_thread;
|
||||
#else
|
||||
static int SDLCALL ThreadProc(void* p_thread);
|
||||
|
||||
SDL_Thread* m_thread;
|
||||
#endif
|
||||
MxBool m_running; // 0x0c
|
||||
MxSemaphore m_semaphore; // 0x10
|
||||
|
||||
|
||||
@ -3,9 +3,6 @@
|
||||
#include "decomp.h"
|
||||
|
||||
#include <SDL3/SDL_timer.h>
|
||||
#ifdef PS2
|
||||
#include <kernel.h>
|
||||
#endif
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxThread, 0x1c)
|
||||
|
||||
@ -13,11 +10,7 @@ DECOMP_SIZE_ASSERT(MxThread, 0x1c)
|
||||
// FUNCTION: BETA10 0x10147540
|
||||
MxThread::MxThread()
|
||||
{
|
||||
#ifdef PS2
|
||||
m_thread = 0;
|
||||
#else
|
||||
m_thread = NULL;
|
||||
#endif
|
||||
m_running = TRUE;
|
||||
}
|
||||
|
||||
@ -26,13 +19,7 @@ MxThread::MxThread()
|
||||
MxThread::~MxThread()
|
||||
{
|
||||
if (m_thread) {
|
||||
#ifdef PS2
|
||||
ReleaseWaitThread(m_thread);
|
||||
DeleteThread(m_thread);
|
||||
m_thread = 0;
|
||||
#else
|
||||
SDL_WaitThread(m_thread, NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,23 +30,6 @@ MxResult MxThread::Start(MxS32 p_stackSize, MxS32 p_flag)
|
||||
MxResult result = FAILURE;
|
||||
|
||||
if (m_semaphore.Init(0, 1) != SUCCESS) {
|
||||
#ifdef PS2
|
||||
ee_thread_t thread;
|
||||
thread.func = (void*)&(MxThread::ThreadProc);
|
||||
thread .stack_size = p_stackSize * 4;
|
||||
thread.initial_priority = 0x18;
|
||||
int thid = CreateThread(&thread);
|
||||
|
||||
if (thid >= 0) {
|
||||
MxThread* self = this;
|
||||
int start = StartThread(thid, &self);
|
||||
if (start >= 0) {
|
||||
result = SUCCESS;
|
||||
m_thread = thid; // store thread ID if needed
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -75,7 +45,6 @@ MxResult MxThread::Start(MxS32 p_stackSize, MxS32 p_flag)
|
||||
|
||||
SDL_DestroyProperties(props);
|
||||
}
|
||||
#endif
|
||||
|
||||
result = SUCCESS;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user