diff options
Diffstat (limited to 'lib/system')
-rwxr-xr-x | lib/system/threads.nim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/system/threads.nim b/lib/system/threads.nim index 2079762f8..9fbea2e1a 100755 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -252,8 +252,10 @@ type object of TGcThread ## Nimrod thread. A thread is a heavy object (~14K) ## that **must not** be part of a message! Use ## a ``TThreadId`` for that. - dataFn: proc (m: TArg) - when TArg isnot void: + when TArg is void: + dataFn: proc () + else: + dataFn: proc (m: TArg) data: TArg TThreadId*[TArg] = ptr TThread[TArg] ## the current implementation uses ## a pointer as a thread ID. @@ -273,7 +275,7 @@ template ThreadProcWrapperBody(closure: expr) = when defined(registerThread): t.stackBottom = addr(t) registerThread(t) - if TArg is void: t.dataFn() + when TArg is void: t.dataFn() else: t.dataFn(t.data) when defined(registerThread): unregisterThread(t) when defined(deallocOsPages): deallocOsPages() |