aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-03-11 15:51:57 +0000
committerGitHub <noreply@github.com>2025-03-11 15:51:57 +0000
commitd5fe392edd16f72448cc068eace3d50a0300ca6c (patch)
tree23dbc5fa0062fdd84b3c9eae697226cf8197b415 /src
parentd15be94a0f161a69cad95e3d27c25aa46924200a (diff)
parent00595073740f6cdc512ae93c09edda2d33c3bb3c (diff)
Merge pull request #4927 from voutilad/openbsd-futex
Fix futex(2) usage on OpenBSD.
Diffstat (limited to 'src')
-rw-r--r--src/threading.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/threading.cpp b/src/threading.cpp
index af8fd803c..a0d1c4049 100644
--- a/src/threading.cpp
+++ b/src/threading.cpp
@@ -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;
}