mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 13:00:28 +00:00
Revert mutex_lock logic
This commit is contained in:
@@ -367,9 +367,9 @@ gb_internal void semaphore_wait(Semaphore *s) {
|
||||
|
||||
gb_internal void mutex_lock(BlockingMutex *m) {
|
||||
ANNOTATE_LOCK_PRE(m, 0);
|
||||
i32 expected = Internal_Mutex_State_Unlocked;
|
||||
if (m->state().compare_exchange_strong(expected, Internal_Mutex_State_Locked, std::memory_order_acquire)) {
|
||||
mutex_lock_slow(m, expected);
|
||||
i32 v = m->state().exchange(Internal_Mutex_State_Locked, std::memory_order_acquire);
|
||||
if (v != Internal_Mutex_State_Unlocked) {
|
||||
mutex_lock_slow(m, v);
|
||||
}
|
||||
ANNOTATE_LOCK_POST(m);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user