mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Make more improvements to threading support
- fix rare thread exit race condition on openbsd - pthread_getattr_np() now supplies detached status - child threads may now pthread_join() the main thread - introduce sigandset(), sigorset(), and sigisemptyset() - introduce pthread_cleanup_push() and pthread_cleanup_pop()
This commit is contained in:
parent
38df0a4186
commit
4a6fd3d910
52 changed files with 586 additions and 241 deletions
|
@ -65,15 +65,15 @@
|
|||
errno_t pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr,
|
||||
size_t stacksize) {
|
||||
if (!stackaddr) {
|
||||
attr->stackaddr = 0;
|
||||
attr->stacksize = 0;
|
||||
attr->__stackaddr = 0;
|
||||
attr->__stacksize = 0;
|
||||
return 0;
|
||||
}
|
||||
if (stacksize < PTHREAD_STACK_MIN ||
|
||||
(IsAsan() && !__asan_is_valid(stackaddr, stacksize))) {
|
||||
return EINVAL;
|
||||
}
|
||||
attr->stackaddr = stackaddr;
|
||||
attr->stacksize = stacksize;
|
||||
attr->__stackaddr = stackaddr;
|
||||
attr->__stacksize = stacksize;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue