commit fcd57d0e6a746d6dfaca53b9fbdaf0c5f0c11cfd parent bd18dda0f3aa406641f7f55a8e67c6deddfd8030 Author: Michael Savage <mikejsavage@gmail.com> Date: Wed Jan 25 22:14:14 +0200 Improve Windows thread_init error checking Diffstat:
win32_thread.h | | | 8 | ++++---- |
diff --git a/win32_thread.h b/win32_thread.h @@ -16,11 +16,11 @@ inline void thread_init( Thread * thread, ThreadCallback callback, void * data ) DWORD id; HANDLE handle = CreateThread( 0, 0, callback, data, 0, &id ); if( handle == NULL ) { - // TODO: make ERROR for windows properly. - printf( "CreateThread failed" ); - exit( 1 ); + FATAL( "CreateThread" ); + } + if( CloseHandle( handle ) ) { + FATAL( "CloseHandle" ); } - CloseHandle( handle ); } inline u64 thread_getid() {