Improve multithreading

This commit is contained in:
Justine Tunney 2024-07-21 06:41:30 -07:00
parent d3167126aa
commit 30afd6ddbb
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
38 changed files with 752 additions and 174 deletions

View file

@ -18,6 +18,7 @@
*/
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/limits.h"
#include "libc/thread/thread.h"
/**
@ -71,6 +72,8 @@ errno_t pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr,
attr->__stacksize = 0;
return 0;
}
if (stacksize > INT_MAX)
return EINVAL;
if (stacksize < PTHREAD_STACK_MIN)
return EINVAL;
attr->__stackaddr = stackaddr;