createThread is more convenient to use with a proc taking no arguments

This commit is contained in:
Araq
2015-10-19 16:09:06 +02:00
parent c977daf9d8
commit 03550f14f8

View File

@@ -455,6 +455,9 @@ else:
cpusetIncl(cpu.cint, s)
setAffinity(t.sys, sizeof(s), s)
proc createThread*(t: var Thread[void], tp: proc () {.thread.}) =
createThread[void](t, tp)
proc threadId*[TArg](t: var Thread[TArg]): ThreadId[TArg] {.inline.} =
## returns the thread ID of `t`.
result = addr(t)