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
commit 22d0a39932
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -319,7 +319,10 @@ else:
when hasSharedHeap: t.core.stackSize = ThreadStackSize when hasSharedHeap: t.core.stackSize = ThreadStackSize
var a {.noinit.}: Pthread_attr var a {.noinit.}: Pthread_attr
doAssert pthread_attr_init(a) == 0 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: if pthread_create(t.sys, a, threadProcWrapper[TArg], addr(t)) != 0:
raise newException(ResourceExhaustedError, "cannot create thread") raise newException(ResourceExhaustedError, "cannot create thread")
doAssert pthread_attr_destroy(a) == 0 doAssert pthread_attr_destroy(a) == 0