mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 00:08:30 +00:00
Support futexes on FreeBSD
This commit is contained in:
parent
795d295590
commit
7549a5755e
10 changed files with 81 additions and 31 deletions
|
@ -29,6 +29,7 @@
|
|||
#include "libc/nt/runtime.h"
|
||||
#include "libc/nt/synchronization.h"
|
||||
#include "libc/sysv/consts/futex.h"
|
||||
#include "libc/thread/freebsd.internal.h"
|
||||
#include "libc/thread/wait0.internal.h"
|
||||
|
||||
int _futex(atomic_int *, int, int, const struct timespec *);
|
||||
|
@ -64,6 +65,8 @@ static void _wait0_futex(const atomic_int *a, int e) {
|
|||
} else {
|
||||
rc = -GetLastError();
|
||||
}
|
||||
} else if (IsFreebsd()) {
|
||||
rc = sys_umtx_op(a, UMTX_OP_WAIT_UINT, 0, 0, 0);
|
||||
} else {
|
||||
rc = _futex(a, op, e, 0);
|
||||
if (IsOpenbsd() && rc > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue