mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
Use standard wait result types in C4JThread
This commit is contained in:
parent
506964f2b4
commit
4f5695d4af
|
|
@ -383,7 +383,7 @@ void C4JThread::SetPriority(int priority) {
|
||||||
#endif // __PS3__
|
#endif // __PS3__
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD C4JThread::WaitForCompletion(int timeoutMs) {
|
std::uint32_t C4JThread::WaitForCompletion(int timeoutMs) {
|
||||||
#ifdef __PS3__
|
#ifdef __PS3__
|
||||||
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
|
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
|
||||||
return m_completionFlag->WaitForSignal(timeoutMs);
|
return m_completionFlag->WaitForSignal(timeoutMs);
|
||||||
|
|
@ -543,7 +543,7 @@ void C4JThread::Event::Clear() {
|
||||||
#endif //__PS3__
|
#endif //__PS3__
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD C4JThread::Event::WaitForSignal(int timeoutMs) {
|
std::uint32_t C4JThread::Event::WaitForSignal(int timeoutMs) {
|
||||||
#ifdef __PS3__
|
#ifdef __PS3__
|
||||||
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
|
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
|
||||||
int timoutMicrosecs = timeoutMs * 1000;
|
int timoutMicrosecs = timeoutMs * 1000;
|
||||||
|
|
@ -685,8 +685,8 @@ void C4JThread::EventArray::ClearAll() {
|
||||||
for (int i = 0; i < m_size; i++) Clear(i);
|
for (int i = 0; i < m_size; i++) Clear(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD C4JThread::EventArray::WaitForSingle(int index, int timeoutMs) {
|
std::uint32_t C4JThread::EventArray::WaitForSingle(int index, int timeoutMs) {
|
||||||
DWORD retVal;
|
std::uint32_t retVal;
|
||||||
#ifdef __PS3__
|
#ifdef __PS3__
|
||||||
int timeoutMicrosecs;
|
int timeoutMicrosecs;
|
||||||
if (timeoutMs == INFINITE)
|
if (timeoutMs == INFINITE)
|
||||||
|
|
@ -777,8 +777,8 @@ DWORD C4JThread::EventArray::WaitForSingle(int index, int timeoutMs) {
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD C4JThread::EventArray::WaitForAll(int timeoutMs) {
|
std::uint32_t C4JThread::EventArray::WaitForAll(int timeoutMs) {
|
||||||
DWORD retVal;
|
std::uint32_t retVal;
|
||||||
#ifdef __PS3__
|
#ifdef __PS3__
|
||||||
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
|
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
|
||||||
int timoutMicrosecs = timeoutMs * 1000;
|
int timoutMicrosecs = timeoutMs * 1000;
|
||||||
|
|
@ -871,7 +871,7 @@ DWORD C4JThread::EventArray::WaitForAll(int timeoutMs) {
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD C4JThread::EventArray::WaitForAny(int timeoutMs) {
|
std::uint32_t C4JThread::EventArray::WaitForAny(int timeoutMs) {
|
||||||
#ifdef __PS3__
|
#ifdef __PS3__
|
||||||
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
|
if (timeoutMs == INFINITE) timeoutMs = SYS_NO_TIMEOUT;
|
||||||
int timoutMicrosecs = timeoutMs * 1000;
|
int timoutMicrosecs = timeoutMs * 1000;
|
||||||
|
|
@ -1015,7 +1015,7 @@ void C4JThread::EventQueue::threadPoll() {
|
||||||
if (m_threadInitFunc) m_threadInitFunc();
|
if (m_threadInitFunc) m_threadInitFunc();
|
||||||
|
|
||||||
while (ShutdownManager::ShouldRun(ShutdownManager::eEventQueueThreads)) {
|
while (ShutdownManager::ShouldRun(ShutdownManager::eEventQueueThreads)) {
|
||||||
DWORD err = m_startEvent->WaitForAny(INFINITE);
|
std::uint32_t err = m_startEvent->WaitForAny(INFINITE);
|
||||||
if (err == WAIT_OBJECT_0) {
|
if (err == WAIT_OBJECT_0) {
|
||||||
bool bListEmpty = true;
|
bool bListEmpty = true;
|
||||||
do {
|
do {
|
||||||
|
|
@ -1060,4 +1060,4 @@ void C4JThread::PopAffinity() {
|
||||||
assert(err == SCE_OK);
|
assert(err == SCE_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // __ORBIS__
|
#endif // __ORBIS__
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public:
|
||||||
~Event();
|
~Event();
|
||||||
void Set();
|
void Set();
|
||||||
void Clear();
|
void Clear();
|
||||||
DWORD WaitForSignal(int timeoutMs);
|
std::uint32_t WaitForSignal(int timeoutMs);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
EMode m_mode;
|
EMode m_mode;
|
||||||
|
|
@ -89,9 +89,9 @@ public:
|
||||||
void Clear(int index);
|
void Clear(int index);
|
||||||
void SetAll();
|
void SetAll();
|
||||||
void ClearAll();
|
void ClearAll();
|
||||||
DWORD WaitForAll(int timeoutMs);
|
std::uint32_t WaitForAll(int timeoutMs);
|
||||||
DWORD WaitForAny(int timeoutMs);
|
std::uint32_t WaitForAny(int timeoutMs);
|
||||||
DWORD WaitForSingle(int index, int timeoutMs);
|
std::uint32_t WaitForSingle(int index, int timeoutMs);
|
||||||
#ifdef __PS3__
|
#ifdef __PS3__
|
||||||
void Cancel();
|
void Cancel();
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -153,7 +153,7 @@ public:
|
||||||
bool hasStarted() { return m_hasStarted; }
|
bool hasStarted() { return m_hasStarted; }
|
||||||
void SetProcessor(int proc);
|
void SetProcessor(int proc);
|
||||||
void SetPriority(int priority);
|
void SetPriority(int priority);
|
||||||
DWORD WaitForCompletion(int timeoutMs);
|
std::uint32_t WaitForCompletion(int timeoutMs);
|
||||||
int GetExitCode();
|
int GetExitCode();
|
||||||
char* getName() { return m_threadName; }
|
char* getName() { return m_threadName; }
|
||||||
static void Sleep(int millisecs);
|
static void Sleep(int millisecs);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue