diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-03-10 22:55:19 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-10-30 00:41:14 -0400 |
commit | 4e4a73868488f83aa9d355d147e116408634c140 (patch) | |
tree | 7b54075262dcddb23db4cb1dbed9987857d5e6ba /rts/win32 | |
parent | d44f523208d32b599fa7e1260de32515d2ef9944 (diff) | |
download | haskell-4e4a73868488f83aa9d355d147e116408634c140.tar.gz |
rts: Join to concurrent mark thread during shutdown
Previously we would take all capabilities but fail to join on the thread
itself, potentially resulting in a leaked thread.
Diffstat (limited to 'rts/win32')
-rw-r--r-- | rts/win32/OSThreads.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rts/win32/OSThreads.c b/rts/win32/OSThreads.c index f3bdefd998..ed8a598e51 100644 --- a/rts/win32/OSThreads.c +++ b/rts/win32/OSThreads.c @@ -444,6 +444,15 @@ interruptOSThread (OSThreadId id) CloseHandle(hdl); } +void +joinOSThread (OSThreadId id) +{ + int ret = WaitForSingleObject(id, INFINITE); + if (ret != WAIT_OBJECT_0) { + sysErrorBelch("joinOSThread: error %d", ret); + } +} + void setThreadNode (uint32_t node) { if (osNumaAvailable()) |