aboutsummaryrefslogtreecommitdiffstats
path: root/src/gos/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gos/win32.c')
-rw-r--r--src/gos/win32.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gos/win32.c b/src/gos/win32.c
index bda57f6f..a1c5abcd 100644
--- a/src/gos/win32.c
+++ b/src/gos/win32.c
@@ -96,15 +96,24 @@ semcount_t gfxSemCounter(gfxSem *pSem) {
return BasicInfo.CurrentCount;
}
-bool_t gfxCreateThread(void *stackarea, size_t stacksz, threadpriority_t prio, gfxThreadFunction fn, void *param) {
- (void) stackarea;
+gfxThreadHandle gfxThreadCreate(void *stackarea, size_t stacksz, threadpriority_t prio, DECLARE_THREAD_FUNCTION((*fn),p), void *param) {
+ (void) stackarea;
HANDLE thd;
if (!(thd = CreateThread(NULL, stacksz, fn, param, CREATE_SUSPENDED, NULL)))
return FALSE;
SetThreadPriority(thd, prio);
ResumeThread(thd);
- return TRUE;
+ return thd;
+}
+
+threadreturn_t gfxThreadWait(gfxThreadHandle thread) {
+ DWORD ret;
+
+ WaitForSingleObject(thread, INFINITE);
+ GetExitCodeThread(thread, &ret);
+ CloseHandle(thread);
+ return ret;
}
#endif /* GFX_USE_OS_WIN32 */