Merge pull request #4927 from voutilad/openbsd-futex

Fix futex(2) usage on OpenBSD.
This commit is contained in:
gingerBill
2025-03-11 15:51:57 +00:00
committed by GitHub

View File

@@ -756,7 +756,7 @@ gb_internal void futex_signal(Futex *f) {
perror("Futex wake");
GB_PANIC("futex wake fail");
} else if (ret == 1) {
} else {
return;
}
}
@@ -773,7 +773,7 @@ gb_internal void futex_broadcast(Futex *f) {
perror("Futex wake");
GB_PANIC("futex wake fail");
} else if (ret == 1) {
} else {
return;
}
}
@@ -783,7 +783,7 @@ gb_internal void futex_wait(Futex *f, Footex val) {
for (;;) {
int ret = futex((volatile uint32_t *)f, FUTEX_WAIT | FUTEX_PRIVATE_FLAG, val, NULL, NULL);
if (ret == -1) {
if (*f != val) {
if (errno == EAGAIN) {
return;
}