From 60ff21fb3139286e7a79ea73e4b9ae28d6a5524b Mon Sep 17 00:00:00 2001 From: John Wiseman Date: Thu, 6 Apr 2023 13:41:09 +0100 Subject: 6.0.23.59 --- compatbits.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'compatbits.c') diff --git a/compatbits.c b/compatbits.c index ea8a913..c485a81 100644 --- a/compatbits.c +++ b/compatbits.c @@ -139,7 +139,30 @@ pthread_t _beginthread(void(*start_address)(), unsigned stack_size, VOID * argli { pthread_t thread; - if (pthread_create(&thread, NULL, (void * (*)(void *))start_address, (void*) arglist) != 0) + // Need to set stack size for Mac + + int s, tnum, opt, num_threads; + struct thread_info *tinfo; + pthread_attr_t attr; + void *res; + + s = pthread_attr_init(&attr); + if (s != 0) + { + perror("pthread_attr_init"); + return 0; + } + if (stack_size > 0) + { + s = pthread_attr_setstacksize(&attr, stack_size); + if (s != 0) + { + perror("pthread_attr_setstacksize"); + return 0; + } + } + + if (pthread_create(&thread, &attr, (void * (*)(void *))start_address, (void*) arglist) != 0) perror("New Thread"); else pthread_detach(thread); -- cgit v1.2.3