Skip to content
Snippets Groups Projects
Commit d8c5576f authored by Ben Gamari's avatar Ben Gamari
Browse files

rts: Fix joinOSThread on Windows

Previously we were treating the thread ID as a HANDLE, but it is not. We
must first OpenThread.

(cherry picked from commit 63a5c876)
parent 84439211
No related branches found
No related tags found
No related merge requests found
......@@ -447,7 +447,12 @@ interruptOSThread (OSThreadId id)
void
joinOSThread (OSThreadId id)
{
int ret = WaitForSingleObject(id, INFINITE);
HANDLE hdl;
if (!(hdl = OpenThread(SYNCHRONIZE,FALSE,id))) {
sysErrorBelch("interruptOSThread: OpenThread");
stg_exit(EXIT_FAILURE);
}
int ret = WaitForSingleObject(hdl, INFINITE);
if (ret != WAIT_OBJECT_0) {
sysErrorBelch("joinOSThread: error %d", ret);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment