Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
36896b68
Commit
36896b68
authored
Oct 14, 2010
by
basvandijk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use throwIO instead of throw in runInBoundThread and runInUnboundThread
parent
3b01da3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
libraries/base/Control/Concurrent.hs
libraries/base/Control/Concurrent.hs
+7
-10
No files found.
libraries/base/Control/Concurrent.hs
View file @
36896b68
...
...
@@ -406,13 +406,10 @@ runInBoundThread action
else
do
ref
<-
newIORef
undefined
let
action_plus
=
Exception
.
try
action
>>=
writeIORef
ref
resultOrException
<-
bracket
(
newStablePtr
action_plus
)
freeStablePtr
(
\
cEntry
->
forkOS_entry_reimported
cEntry
>>
readIORef
ref
)
case
resultOrException
of
Left
exception
->
Exception
.
throw
(
exception
::
SomeException
)
Right
result
->
return
result
bracket
(
newStablePtr
action_plus
)
freeStablePtr
(
\
cEntry
->
forkOS_entry_reimported
cEntry
>>
readIORef
ref
)
>>=
unsafeResult
|
otherwise
=
failNonThreaded
{- |
...
...
@@ -437,11 +434,11 @@ runInUnboundThread action = do
_
<-
mask
$
\
restore
->
forkIO
$
Exception
.
try
(
if
b
then
action
else
restore
action
)
>>=
putMVar
mv
takeMVar
mv
>>=
\
ei
->
case
ei
of
Left
exception
->
Exception
.
throw
(
exception
::
SomeException
)
Right
result
->
return
result
takeMVar
mv
>>=
unsafeResult
else
action
unsafeResult
::
Either
SomeException
a
->
IO
a
unsafeResult
=
either
Exception
.
throwIO
return
#
endif
/*
__GLASGOW_HASKELL__
*/
#
ifdef
__GLASGOW_HASKELL__
...
...
Write
Preview
Markdown
is supported
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