diff options
author | Araq <rumpf_a@web.de> | 2011-09-20 00:56:48 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-09-20 00:56:48 +0200 |
commit | fd62116f6eb80d1dd3d6cc745d80629ad32dca1a (patch) | |
tree | ac5cbd102ffa580e322eda22deeef9298babae4a /lib/system | |
parent | dc3ace4f379931f2af4dd4a3cd2a0984a94865af (diff) | |
download | Nim-fd62116f6eb80d1dd3d6cc745d80629ad32dca1a.tar.gz |
bugfixes for generics; new threads implementation still broken
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() |