Update again

This commit is contained in:
GabsPuNs
2026-05-10 20:53:21 -04:00
parent c5fee249d8
commit 20d395b88d
5 changed files with 72 additions and 44 deletions

View File

@@ -194,6 +194,14 @@ C4JThread::~C4JThread()
}
LeaveCriticalSection(&ms_threadListCS);
#ifdef _WINDOWS64
if (m_threadHandle != nullptr && m_threadHandle != (HANDLE)-2)
{
CloseHandle(m_threadHandle);
m_threadHandle = nullptr;
}
#endif
}
#ifdef __PS3__
@@ -295,6 +303,8 @@ void C4JThread::SetProcessor( int proc )
app.DebugPrintf("***************************** set thread proc %s %d %d %d **************************\n", m_threadName, proc, Mask, Newmask);
#elif defined _DURANGO
SetThreadAffinityMask(m_threadHandle, 1 << proc );
#elif defined _WINDOWS64
SetThreadIdealProcessor(m_threadHandle, proc );
#else
XSetThreadProcessor( m_threadHandle, proc);
#endif
@@ -636,6 +646,19 @@ C4JThread::EventArray::EventArray( int size, EMode mode/* = e_modeAutoClear*/)
#endif // __PS3__
}
C4JThread::EventArray::~EventArray()
{
#ifdef _WINDOWS64
if (m_events) {
for (int i = 0; i < m_size; i++) {
if (m_events[i] != nullptr) {
CloseHandle(m_events[i]);
}
}
delete[] m_events;
}
#endif
}
void C4JThread::EventArray::Set(int index)
{