mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
createThread is more convenient to use with a proc taking no arguments
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user