mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +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:
+1
-1
@@ -210,7 +210,7 @@ gb_internal void semaphore_wait(Semaphore *s) {
|
|||||||
original_count = s->count().load(std::memory_order_relaxed);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user