diff options
Diffstat (limited to 'lib/system')
-rwxr-xr-x | lib/system/excpt.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 9bdc69569..e2d3bea08 100755 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -106,9 +106,10 @@ when hasThreadSupport: PGlobals = ptr TGlobals var globalsSlot = ThreadVarAlloc() - proc CreateThreadLocalStorage*() {.inl.} = + proc CreateThreadLocalStorage*(): pointer {.inl.} = isMultiThreaded = true - ThreadVarSetValue(globalsSlot, alloc0(sizeof(TGlobals))) + result = alloc0(sizeof(TGlobals)) + ThreadVarSetValue(globalsSlot, result) proc GetGlobals(): PGlobals {.compilerRtl, inl.} = result = cast[PGlobals](ThreadVarGetValue(globalsSlot)) |