From 03550f14f8aeeba4db7cdb19294d15432e8a707a Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 19 Oct 2015 16:09:06 +0200 Subject: [PATCH] createThread is more convenient to use with a proc taking no arguments --- lib/system/threads.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/system/threads.nim b/lib/system/threads.nim index c5de841f8..bdb737e35 100644 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -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)