Dont assert on setstacksize result in iOS (#15427) [backport:1.2]

This commit is contained in:
Yuriy Glukhov
2020-09-29 17:55:53 +03:00
committed by GitHub
parent 5f9b366180
commit 22d0a39932

View File

@@ -319,7 +319,10 @@ else:
when hasSharedHeap: t.core.stackSize = ThreadStackSize
var a {.noinit.}: Pthread_attr
doAssert pthread_attr_init(a) == 0
doAssert pthread_attr_setstacksize(a, ThreadStackSize) == 0
let setstacksizeResult = pthread_attr_setstacksize(a, ThreadStackSize)
when not defined(ios):
# This fails on iOS
doAssert(setstacksizeResult == 0)
if pthread_create(t.sys, a, threadProcWrapper[TArg], addr(t)) != 0:
raise newException(ResourceExhaustedError, "cannot create thread")
doAssert pthread_attr_destroy(a) == 0