diff options
| author | Dave Voutila <voutilad@gmail.com> | 2025-03-11 10:28:48 -0400 |
|---|---|---|
| committer | Dave Voutila <voutilad@gmail.com> | 2025-03-11 10:28:48 -0400 |
| commit | 00595073740f6cdc512ae93c09edda2d33c3bb3c (patch) | |
| tree | 04f661ec45dc7d8d9f13e52a51c0df5d5bb362dd /src/threading.cpp | |
| parent | a91d528af662fbcedfa30b3d860739f09eb7acd6 (diff) | |
Fix futex(8) usage on OpenBSD.
Diffstat (limited to 'src/threading.cpp')
| -rw-r--r-- | src/threading.cpp | 6 |
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; } |