summaryrefslogtreecommitdiff
path: root/rts/CheckUnload.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2014-12-04 10:12:01 +0000
committerSimon Marlow <marlowsd@gmail.com>2014-12-05 10:06:13 +0000
commit55a2a0b4893486e5dde151620d7f46e8035d2af5 (patch)
treeea727a15ccceaf00d761252340331d2154d76b67 /rts/CheckUnload.c
parent78edd76047d255bb543f7ce5517477f371bb2f0b (diff)
downloadhaskell-55a2a0b4893486e5dde151620d7f46e8035d2af5.tar.gz
Revert "Revert "Make the linker API thread-safe""
Also includes a fix for the segfaults on Windows caused by the original version of this patch. This reverts commit 4b51194df4090d984f02c12128e868077660fb8b.
Diffstat (limited to 'rts/CheckUnload.c')
-rw-r--r--rts/CheckUnload.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/rts/CheckUnload.c b/rts/CheckUnload.c
index c63a35a24e..73573fbb34 100644
--- a/rts/CheckUnload.c
+++ b/rts/CheckUnload.c
@@ -260,6 +260,8 @@ void checkUnload (StgClosure *static_objects)
if (unloaded_objects == NULL) return;
+ ACQUIRE_LOCK(&linker_mutex);
+
// Mark every unloadable object as unreferenced initially
for (oc = unloaded_objects; oc; oc = oc->next) {
IF_DEBUG(linker, debugBelch("Checking whether to unload %" PATH_FMT "\n",
@@ -317,4 +319,6 @@ void checkUnload (StgClosure *static_objects)
}
freeHashTable(addrs, NULL);
+
+ RELEASE_LOCK(&linker_mutex);
}