tthread_createthread.nim 255 B

12345678910111213141516
  1. discard """
  2. targets: "cpp"
  3. cmd: "nim cpp --hints:on --threads:on $options $file"
  4. """
  5. proc threadMain(a: int) {.thread.} =
  6. discard
  7. proc main() =
  8. var thread: Thread[int]
  9. thread.createThread(threadMain, 0)
  10. thread.joinThreads()
  11. main()