Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
4760739d
Commit
4760739d
authored
Nov 05, 2008
by
Simon Marlow
Browse files
deadlock fix: reset the flag *after* checking the blackhole queue
parent
840eb5b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/Schedule.c
View file @
4760739d
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment