tlet_spawn.nim 269 B

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