diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2024-01-16 18:09:02 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-16 18:09:02 +0000 |
| commit | f2d3376c0b3ee04e61efb0bd2b7cdfc547743531 (patch) | |
| tree | 3af601fa5e0c4bd47a41987bed0bfb4995452869 /src | |
| parent | ae0be9c78587a13857f03cdc08602cf2e6a9282b (diff) | |
| parent | 7b53dbeb8afe110f90347c171cd28c317ac762d0 (diff) | |
Merge pull request #3084 from stan680/semaphore-fix
Fix loop condition in semaphore_wait
Diffstat (limited to 'src')
| -rw-r--r-- | src/threading.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/threading.cpp b/src/threading.cpp index 74aa3eb7e..c283da425 100644 --- a/src/threading.cpp +++ b/src/threading.cpp @@ -210,7 +210,7 @@ gb_internal void semaphore_wait(Semaphore *s) { original_count = s->count().load(std::memory_order_relaxed); } - if (!s->count().compare_exchange_strong(original_count, original_count-1, std::memory_order_acquire, std::memory_order_acquire)) { + if (s->count().compare_exchange_strong(original_count, original_count-1, std::memory_order_acquire, std::memory_order_acquire)) { return; } } |