Skip to content

Instantly share code, notes, and snippets.

@treeform
Created January 13, 2020 15:43
Show Gist options
  • Save treeform/56ca19868d8756b714769eca6d8fcc34 to your computer and use it in GitHub Desktop.
Save treeform/56ca19868d8756b714769eca6d8fcc34 to your computer and use it in GitHub Desktop.
type FooThread = ref object
thread: Thread[void]
var fooThreads: seq[FooThread]
for i in 0 ..< 5:
var t = FooThread()
createThread(t.thread, threadFunc)
fooThreads.add t
for t in fooThreads:
joinThread(t.thread)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment