diff options
author | Simon Marlow <marlowsd@gmail.com> | 2014-12-04 10:12:01 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2014-12-05 10:06:13 +0000 |
commit | 55a2a0b4893486e5dde151620d7f46e8035d2af5 (patch) | |
tree | ea727a15ccceaf00d761252340331d2154d76b67 /rts/CheckUnload.c | |
parent | 78edd76047d255bb543f7ce5517477f371bb2f0b (diff) | |
download | haskell-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.c | 4 |
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); } |