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
Alex D
GHC
Commits
20ba7f1a
Commit
20ba7f1a
authored
Jun 05, 2012
by
Simon Marlow
Browse files
throwTo: unlock the MSG_THROWTO object before returning (#6103)
parent
fe0ae8d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
rts/RaiseAsync.c
View file @
20ba7f1a
...
...
@@ -156,8 +156,7 @@ throwTo (Capability *cap, // the Capability we hold
MessageThrowTo
*
msg
;
msg
=
(
MessageThrowTo
*
)
allocate
(
cap
,
sizeofW
(
MessageThrowTo
));
// message starts locked; the caller has to unlock it when it is
// ready.
// the message starts locked; see below
SET_HDR
(
msg
,
&
stg_WHITEHOLE_info
,
CCS_SYSTEM
);
msg
->
source
=
source
;
msg
->
target
=
target
;
...
...
@@ -166,9 +165,16 @@ throwTo (Capability *cap, // the Capability we hold
switch
(
throwToMsg
(
cap
,
msg
))
{
case
THROWTO_SUCCESS
:
// unlock the message now, otherwise we leave a WHITEHOLE in
// the heap (#6103)
SET_HDR
(
msg
,
&
stg_MSG_THROWTO_info
,
CCS_SYSTEM
);
return
NULL
;
case
THROWTO_BLOCKED
:
default:
// the caller will unlock the message when it is ready. We
// cannot unlock it yet, because the calling thread will need
// to tidy up its state first.
return
msg
;
}
}
...
...
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