summaryrefslogtreecommitdiff
path: root/rts/win32
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-03-10 22:55:19 -0400
committerBen Gamari <ben@smart-cactus.org>2020-10-30 00:41:14 -0400
commit4e4a73868488f83aa9d355d147e116408634c140 (patch)
tree7b54075262dcddb23db4cb1dbed9987857d5e6ba /rts/win32
parentd44f523208d32b599fa7e1260de32515d2ef9944 (diff)
downloadhaskell-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.c9
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())