Fixed "is not GC-safe as it calls 'createThread'" when creating a thread in a thread. (#11390)

This commit is contained in:
Dankr4d
2019-06-03 17:13:22 +02:00
committed by Miran
parent 7072eaad73
commit 9d536b90c1

View File

@@ -146,7 +146,7 @@ proc threadProcWrapStackFrame[TArg](thrd: ptr Thread[TArg]) =
when defined(boehmgc):
boehmGC_call_with_stack_base(threadProcWrapDispatch[TArg], thrd)
elif not defined(nogc) and not defined(gogc) and not defined(gcRegions) and not defined(gcDestructors):
var p {.volatile.}: proc(a: ptr Thread[TArg]) {.nimcall.} =
var p {.volatile.}: proc(a: ptr Thread[TArg]) {.nimcall, gcsafe.} =
threadProcWrapDispatch[TArg]
# init the GC for refc/markandsweep
nimGC_setStackBottom(addr(p))