tlet_spawn.nim 225 B

123456789101112131415
  1. import threadpool
  2. proc foo(): int = 999
  3. # test that the disjoint checker deals with 'a = spawn f(); g = spawn f()':
  4. proc main =
  5. parallel:
  6. let f = spawn foo()
  7. let b = spawn foo()
  8. echo "done", f, " ", b
  9. main()