Fixing some shutdown code.

This commit is contained in:
Ben Vanik
2014-01-02 18:58:44 -08:00
parent 125e7278c6
commit 7969349126
11 changed files with 58 additions and 35 deletions

View File

@@ -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

View File

@@ -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_