summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-10-12 15:38:09 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-11-02 16:34:03 +0000
commitd0226ebc4419caba120e6a586b65490d3fb2fd0f (patch)
tree957f4714bd6a0aa1deb5b68aeb4b6d38c32f3c5d
parent49c01f4b744c8d92daf59b37a8cd4a8a3ec84f95 (diff)
downloadhaskell-d0226ebc4419caba120e6a586b65490d3fb2fd0f.tar.gz
fix for a deadlock when using +RTS -hb with -prof -threaded
-rw-r--r--rts/sm/GC.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/rts/sm/GC.c b/rts/sm/GC.c
index 2252cfcd63..b97ff12464 100644
--- a/rts/sm/GC.c
+++ b/rts/sm/GC.c
@@ -407,8 +407,11 @@ GarbageCollect (rtsBool force_major_gc,
// We call processHeapClosureForDead() on every closure destroyed during
// the current garbage collection, so we invoke LdvCensusForDead().
if (RtsFlags.ProfFlags.doHeapProfile == HEAP_BY_LDV
- || RtsFlags.ProfFlags.bioSelector != NULL)
- LdvCensusForDead(N);
+ || RtsFlags.ProfFlags.bioSelector != NULL) {
+ RELEASE_SM_LOCK; // LdvCensusForDead may need to take the lock
+ LdvCensusForDead(N);
+ ACQUIRE_SM_LOCK;
+ }
#endif
// NO MORE EVACUATION AFTER THIS POINT!