aboutsummaryrefslogtreecommitdiff
path: root/src/threading.cpp
diff options
context:
space:
mode:
authorDave Voutila <voutilad@gmail.com>2025-03-11 10:28:48 -0400
committerDave Voutila <voutilad@gmail.com>2025-03-11 10:28:48 -0400
commit00595073740f6cdc512ae93c09edda2d33c3bb3c (patch)
tree04f661ec45dc7d8d9f13e52a51c0df5d5bb362dd /src/threading.cpp
parenta91d528af662fbcedfa30b3d860739f09eb7acd6 (diff)
Fix futex(8) usage on OpenBSD.
Diffstat (limited to 'src/threading.cpp')
-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;
}