mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-30 18:02:02 +00:00
fix loop condition on compare_exhange_strong result in semaphore_wait - it was backwards so would loop on success and bail on fail
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user