summary refs log tree commit diff stats
path: root/tests/threads/trecursive_actor.nim
blob: e2774704c4d37a175c0063d94ada64fd5cde7733 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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()