diff options
| author | John Wiseman <john.wiseman@cantab.net> | 2023-04-06 13:41:09 +0100 |
|---|---|---|
| committer | John Wiseman <john.wiseman@cantab.net> | 2023-04-06 13:41:09 +0100 |
| commit | 60ff21fb3139286e7a79ea73e4b9ae28d6a5524b (patch) | |
| tree | 27e6aae6f24d5ff27c1924387f00de120aacb6a9 /compatbits.c | |
| parent | f1bf68a54506ec51bacdd27ef7eec6ac6732d629 (diff) | |
6.0.23.5923.66
Diffstat (limited to 'compatbits.c')
| -rw-r--r-- | compatbits.c | 25 |
1 files changed, 24 insertions, 1 deletions
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);
|
