summaryrefslogtreecommitdiff
path: root/rts/CheckUnload.c
diff options
context:
space:
mode:
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);
}