Fixing some shutdown code.
This commit is contained in:
@@ -104,6 +104,11 @@ int xe_thread_start(xe_thread_ref thread) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void xe_thread_join(xe_thread_ref thread) {
|
||||
HANDLE thread_handle = (HANDLE)thread->handle;
|
||||
WaitForSingleObject(thread_handle, INFINITE);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static void* xe_thread_callback_pthreads(void* param) {
|
||||
@@ -137,4 +142,8 @@ int xe_thread_start(xe_thread_ref thread) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void xe_thread_join(xe_thread_ref thread) {
|
||||
pthread_join((pthread_t)thread->handle, NULL);
|
||||
}
|
||||
|
||||
#endif // WIN32
|
||||
|
||||
@@ -28,6 +28,7 @@ xe_thread_ref xe_thread_retain(xe_thread_ref thread);
|
||||
void xe_thread_release(xe_thread_ref thread);
|
||||
|
||||
int xe_thread_start(xe_thread_ref thread);
|
||||
void xe_thread_join(xe_thread_ref thread);
|
||||
|
||||
|
||||
#endif // XENIA_CORE_THREAD_H_
|
||||
|
||||
Reference in New Issue
Block a user