fixes #71; sorry about the polling implementation
This commit is contained in:
parent
24e1d22ec9
commit
c6213c9774
6 changed files with 62 additions and 12 deletions
|
|
@ -5,7 +5,6 @@ discard """
|
|||
template myAssert(cond: expr) =
|
||||
when rand(3) < 2:
|
||||
let c = cond.astToStr
|
||||
{.warning: "code activated: " & c.}
|
||||
if not cond:
|
||||
echo c, "ugh"
|
||||
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ proc runThreadTests(r: var TResults, options: string) =
|
|||
|
||||
test "tactors"
|
||||
test "threadex"
|
||||
test "trecursive_actor"
|
||||
#test "threadring"
|
||||
#test "tthreadanalysis"
|
||||
#test "tthreadsort"
|
||||
|
|
|
|||
19
tests/threads/trecursive_actor.nim
Normal file
19
tests/threads/trecursive_actor.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
outputsub: "0"
|
||||
"""
|
||||
|
||||
import actors
|
||||
|
||||
var
|
||||
a: TActorPool[int, void]
|
||||
createActorPool(a)
|
||||
|
||||
proc task(i: int) {.thread.} =
|
||||
echo i
|
||||
if i != 0: a.spawn (i-1, task)
|
||||
|
||||
# count from 9 till 0 and check 0 is somewhere in the output
|
||||
a.spawn(9, task)
|
||||
a.join()
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue