Skip to content

Commit

Permalink
channels test I guess
Browse files Browse the repository at this point in the history
  • Loading branch information
nddrylliog committed Oct 9, 2013
1 parent 45f7954 commit ba3f2df
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/sdk/os/channels.ooc
@@ -0,0 +1,30 @@
import os/Channel

chan := make(Int)

go(||
for (i in 0..5) {
chan << i
yield()
}
chan << -1
)

go(||
for (i in 5..10) {
chan << i
yield()
}
chan << -1
)

go(||
while (true) match (i := !chan) {
case -1 =>
break
case =>
"%d" printfln(i)
yield
}
)

0 comments on commit ba3f2df

Please sign in to comment.