medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 75e7f35012b66e31278e041fc0ee6fd4511a74a7
parent 7957f5a2d36a827fb90f84c4bc70413a29bd4330
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Tue Feb  7 20:23:22 +0200

Add thread_join for Windows

Diffstat:
win32_thread.h | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/win32_thread.h b/win32_thread.h @@ -19,15 +19,16 @@ inline void thread_init( Thread * thread, ThreadCallback callback, void * data ) if( handle == NULL ) { FATAL( "CreateThread" ); } - if( CloseHandle( handle ) == 0 ) { - FATAL( "CloseHandle" ); - } } inline u64 thread_getid() { return checked_cast< u64 >( GetCurrentThreadId() ); } +inline void thread_join( Thread * thread ) { + WaitForSingleObject( thread->handle, INFINITE ); +} + inline void thread_yield() { SwitchToThread(); }