diff options
author | Araq <rumpf_a@web.de> | 2011-11-25 17:26:11 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-11-25 17:26:11 +0100 |
commit | 02e8e9c3ea130882c50326ed83240e29eeffb854 (patch) | |
tree | 457e68f5b7081f92beb0f96077c921bdeafe9843 /lib/system | |
parent | 566c26bc2da7eeb03390ee4c0d7af3d8cafbc561 (diff) | |
download | Nim-02e8e9c3ea130882c50326ed83240e29eeffb854.tar.gz |
fixed bug that kept tls emulation from working
Diffstat (limited to 'lib/system')
-rwxr-xr-x | lib/system/threads.nim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/system/threads.nim b/lib/system/threads.nim index c6b6b4d7c..ce07f0c3b 100755 --- a/lib/system/threads.nim +++ b/lib/system/threads.nim @@ -349,7 +349,7 @@ proc createThread*[TArg](t: var TThread[TArg], if t.sys <= 0: raise newException(EResourceExhausted, "cannot create thread") else: - var a: Tpthread_attr + var a {.noinit.}: Tpthread_attr pthread_attr_init(a) pthread_attr_setstacksize(a, ThreadStackSize) if pthread_create(t.sys, a, threadProcWrapper[TArg], addr(t)) != 0: @@ -363,9 +363,10 @@ proc myThreadId*[TArg](): TThreadId[TArg] = ## returns the thread ID of the thread that calls this proc. result = cast[TThreadId[TArg]](ThreadVarGetValue(globalsSlot)) -proc mainThreadId*[TArg](): TThreadId[TArg] = - ## returns the thread ID of the main thread. - result = cast[TThreadId[TArg]](addr(mainThread)) +when false: + proc mainThreadId*[TArg](): TThreadId[TArg] = + ## returns the thread ID of the main thread. + result = cast[TThreadId[TArg]](addr(mainThread)) when useStackMaskHack: proc runMain(tp: proc () {.thread.}) {.compilerproc.} = |