projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
840eb5b
)
deadlock fix: reset the flag *after* checking the blackhole queue
author
Simon Marlow
<marlowsd@gmail.com>
Wed, 5 Nov 2008 15:05:42 +0000
(15:05 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Wed, 5 Nov 2008 15:05:42 +0000
(15:05 +0000)
rts/Schedule.c
patch
|
blob
|
history
diff --git
a/rts/Schedule.c
b/rts/Schedule.c
index
8ab964d
..
569c3d0
100644
(file)
--- a/
rts/Schedule.c
+++ b/
rts/Schedule.c
@@
-934,8
+934,13
@@
scheduleCheckBlackHoles (Capability *cap)
{
ACQUIRE_LOCK(&sched_mutex);
if ( blackholes_need_checking ) {
- checkBlackHoles(cap);
blackholes_need_checking = rtsFalse;
+ // important that we reset the flag *before* checking the
+ // blackhole queue, otherwise we could get deadlock. This
+ // happens as follows: we wake up a thread that
+ // immediately runs on another Capability, blocks on a
+ // blackhole, and then we reset the blackholes_need_checking flag.
+ checkBlackHoles(cap);
}
RELEASE_LOCK(&sched_mutex);
}