mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +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
|
@ -25,13 +25,14 @@
|
|||
|
||||
int _pthread_reschedule(struct PosixThread *pt) {
|
||||
int rc, e = errno;
|
||||
struct sched_param param = {pt->attr.schedparam};
|
||||
int policy = pt->attr.__schedpolicy;
|
||||
struct sched_param param = {pt->attr.__schedparam};
|
||||
if (IsNetbsd()) {
|
||||
rc = sys_sched_setparam_netbsd(0, pt->tid, pt->attr.schedpolicy, ¶m);
|
||||
rc = sys_sched_setparam_netbsd(0, pt->tid, policy, ¶m);
|
||||
} else if (IsLinux()) {
|
||||
rc = sys_sched_setscheduler(pt->tid, pt->attr.schedpolicy, ¶m);
|
||||
rc = sys_sched_setscheduler(pt->tid, policy, ¶m);
|
||||
} else if (IsFreebsd()) {
|
||||
rc = _pthread_setschedparam_freebsd(pt->tid, pt->attr.schedpolicy, ¶m);
|
||||
rc = _pthread_setschedparam_freebsd(pt->tid, policy, ¶m);
|
||||
} else {
|
||||
rc = enosys();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue