mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 06:48:31 +00:00
Perform some code cleanup
This commit is contained in:
parent
0dd9629562
commit
a4601a24d3
63 changed files with 350 additions and 1643 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "libc/bits/atomic.h"
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/dce.h"
|
||||
#include "libc/intrin/futex.internal.h"
|
||||
#include "libc/intrin/wait0.internal.h"
|
||||
#include "libc/linux/futex.h"
|
||||
|
||||
|
@ -34,8 +35,8 @@ void _wait0(int *ptid) {
|
|||
for (;;) {
|
||||
if (!(x = atomic_load_explicit(ptid, memory_order_relaxed))) {
|
||||
break;
|
||||
} else if (IsLinux()) {
|
||||
LinuxFutexWait(ptid, x, 0);
|
||||
} else if (IsLinux() || IsOpenbsd()) {
|
||||
_futex_wait(ptid, x, &(struct timespec){2});
|
||||
} else {
|
||||
sched_yield();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue