tpws: fix resolver min stack size on some archs

This commit is contained in:
bol-van 2024-09-14 21:00:39 +03:00
parent 482ea8d4c0
commit d4ce24b3af

View File

@ -214,11 +214,13 @@ bool resolver_init(int threads, int fd_signal_pipe)
pthread_attr_t attr; pthread_attr_t attr;
if (pthread_attr_init(&attr)) goto ex; if (pthread_attr_init(&attr)) goto ex;
// set minimum thread stack size // set minimum thread stack size
if (pthread_attr_setstacksize(&attr,20480))
if (pthread_attr_setstacksize(&attr,PTHREAD_STACK_MIN>20480 ? PTHREAD_STACK_MIN : 20480))
{ {
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);
goto ex; goto ex;
} }
for(t=0, resolver.threads=threads ; t<threads ; t++) for(t=0, resolver.threads=threads ; t<threads ; t++)
{ {
if (pthread_create(resolver.thread + t, &attr, resolver_thread, NULL)) if (pthread_create(resolver.thread + t, &attr, resolver_thread, NULL))