Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
da6cae40
Commit
da6cae40
authored
Jul 10, 2008
by
Simon Marlow
Browse files
add test for threadStatus
parent
fa25624d
Changes
3
Hide whitespace changes
Inline
Side-by-side
testsuite/tests/ghc-regress/concurrent/should_run/all.T
View file @
da6cae40
...
...
@@ -11,6 +11,9 @@ test('conc006', normal, compile_and_run, [''])
test
('
conc027
',
normal
,
compile_and_run
,
[''])
test
('
conc051
',
normal
,
compile_and_run
,
[''])
test
('
conc069
',
only_ways
(['
ghci
','
threaded1
','
threaded2
']),
compile_and_run
,
[''])
# this test gives slightly different results for non-threaded ways, so omit
# those for now.
test
('
conc070
',
only_ways
(['
ghci
','
threaded1
','
threaded2
']),
compile_and_run
,
[''])
# -----------------------------------------------------------------------------
# These tests we only do for a full run
...
...
testsuite/tests/ghc-regress/concurrent/should_run/conc070.hs
0 → 100644
View file @
da6cae40
import
Control.Concurrent
import
GHC.Conc
import
Data.List
import
Data.Maybe
main
=
do
t1
<-
forkIO
(
threadDelay
100000000
)
m
<-
newEmptyMVar
t2
<-
forkIO
(
takeMVar
m
)
t3
<-
forkIO
(
let
loop
=
do
r
<-
tryTakeMVar
m
;
_
<-
newEmptyMVar
-- do some allocation :(
if
isNothing
r
then
loop
else
return
()
in
loop
)
t4
<-
forkIO
(
return
()
)
yield
threadDelay
10000
print
=<<
mapM
threadStatus
[
t1
,
t2
,
t3
,
t4
]
putMVar
m
()
testsuite/tests/ghc-regress/concurrent/should_run/conc070.stdout
0 → 100644
View file @
da6cae40
[ThreadBlocked BlockedOnMVar,ThreadBlocked BlockedOnMVar,ThreadRunning,ThreadFinished]
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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