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

(cherry picked from commit 22d0a39932)
This commit is contained in:
Yuriy Glukhov
2020-09-29 17:55:53 +03:00
committed by narimiran
parent c53c6458b0
commit c6d51805be

View File

@@ -311,7 +311,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