Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
ec335ed4
Commit
ec335ed4
authored
Dec 13, 2012
by
Simon Marlow
Browse files
fix qsem001 & qsemn001
parent
65d4f18c
Changes
3
Hide whitespace changes
Inline
Side-by-side
libraries/base/tests/qsem001.stdout
0 → 100644
View file @
ec335ed4
test sem1
test sem2
test sem_kill
test sem_fifo
test sem_bracket
libraries/base/tests/qsemn001.hs
View file @
ec335ed4
...
...
@@ -33,61 +33,61 @@ tests = [
semn
::
Assertion
semn
=
do
c
<-
new
TChanIO
c
<-
new
EmptyMVar
q
<-
new
0
t1
<-
forkIO
$
do
wait
q
1
;
atomically
$
writeTChan
c
'a'
t1
<-
forkIO
$
do
wait
q
1
;
putMVar
c
'a'
threadDelay
10000
t2
<-
forkIO
$
do
wait
q
2
;
atomically
$
writeTChan
c
'b'
t2
<-
forkIO
$
do
wait
q
2
;
putMVar
c
'b'
threadDelay
10000
t3
<-
forkIO
$
do
wait
q
3
;
atomically
$
writeTChan
c
'c'
t3
<-
forkIO
$
do
wait
q
3
;
putMVar
c
'c'
threadDelay
10000
signal
q
1
a
<-
atomically
$
readTChan
c
a
<-
takeMVar
c
signal
q
2
b
<-
atomically
$
readTChan
c
b
<-
takeMVar
c
signal
q
3
c
<-
atomically
$
readTChan
c
c
<-
takeMVar
c
[
a
,
b
,
c
]
@?=
"abc"
semn2
::
Assertion
semn2
=
do
c
<-
new
TChanIO
c
<-
new
EmptyMVar
q
<-
new
0
t1
<-
forkIO
$
do
wait
q
1
;
threadDelay
10000
;
atomically
$
writeTChan
c
'a'
t1
<-
forkIO
$
do
wait
q
1
;
threadDelay
10000
;
putMVar
c
'a'
threadDelay
10000
t2
<-
forkIO
$
do
wait
q
2
;
threadDelay
20000
;
atomically
$
writeTChan
c
'b'
t2
<-
forkIO
$
do
wait
q
2
;
threadDelay
20000
;
putMVar
c
'b'
threadDelay
10000
t3
<-
forkIO
$
do
wait
q
3
;
threadDelay
30000
;
atomically
$
writeTChan
c
'c'
t3
<-
forkIO
$
do
wait
q
3
;
threadDelay
30000
;
putMVar
c
'c'
threadDelay
10000
signal
q
6
a
<-
atomically
$
readTChan
c
b
<-
atomically
$
readTChan
c
c
<-
atomically
$
readTChan
c
a
<-
takeMVar
c
b
<-
takeMVar
c
c
<-
takeMVar
c
[
a
,
b
,
c
]
@?=
"abc"
semn3
::
Assertion
semn3
=
do
c
<-
new
TChanIO
c
<-
new
EmptyMVar
q
<-
new
0
t1
<-
forkIO
$
do
wait
q
1
;
threadDelay
10000
;
atomically
$
writeTChan
c
'a'
t1
<-
forkIO
$
do
wait
q
1
;
threadDelay
10000
;
putMVar
c
'a'
threadDelay
10000
t2
<-
forkIO
$
do
wait
q
2
;
threadDelay
20000
;
atomically
$
writeTChan
c
'b'
t2
<-
forkIO
$
do
wait
q
2
;
threadDelay
20000
;
putMVar
c
'b'
threadDelay
10000
t3
<-
forkIO
$
do
wait
q
3
;
threadDelay
30000
;
atomically
$
writeTChan
c
'c'
t3
<-
forkIO
$
do
wait
q
3
;
threadDelay
30000
;
putMVar
c
'c'
threadDelay
10000
signal
q
3
a
<-
atomically
$
readTChan
c
b
<-
atomically
$
readTChan
c
a
<-
takeMVar
c
b
<-
takeMVar
c
threadDelay
10000
[
a
,
b
]
@?=
"ab"
d
<-
atomically
$
isEmpty
TChan
c
d
<-
isEmpty
MVar
c
d
@?=
True
signal
q
1
threadDelay
10000
d
<-
atomically
$
isEmpty
TChan
c
d
<-
isEmpty
MVar
c
d
@?=
True
signal
q
2
x
<-
atomically
$
readTChan
c
x
<-
takeMVar
c
x
@?=
'c'
semn_kill
::
Assertion
...
...
libraries/base/tests/qsemn001.stdout
0 → 100644
View file @
ec335ed4
test semn
test semn2
test semn3
test semn_kill
test semn_bracket
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