diff options
| -rw-r--r-- | test/threads.tm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/threads.tm b/test/threads.tm index 7024460c..95cfbb5b 100644 --- a/test/threads.tm +++ b/test/threads.tm @@ -1,12 +1,13 @@ enum Job(Increment(x:Int), Decrement(x:Int)) func main(): - jobs := |:Job; max_size=1| - results := |:Int; max_size=2| + jobs := |:Job; max_size=2| + results := |:Int; max_size| >> thread := Thread.new(func(): //! In another thread! while yes: - when jobs:pop() is Increment(x): + >> got := jobs:pop() + when got is Increment(x): >> results:push(x+1) is Decrement(x): >> results:push(x-1) |
