Skip to content

Commit

Permalink
Merge pull request #93709 from RandomShaper/fix_antilock_bad_mutex
Browse files Browse the repository at this point in the history
WorkerThreadPool: Fix wrong pointer used in the case of BinaryMutex
  • Loading branch information
akien-mga committed Jun 29, 2024
2 parents 0b23be9 + f2f9a6b commit d6385d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/object/worker_thread_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ void WorkerThreadPool::_lock_unlockable_mutexes() {
if ((((uintptr_t)unlockable_mutexes[i]) & 1) == 0) {
((Mutex *)unlockable_mutexes[i])->lock();
} else {
((BinaryMutex *)unlockable_mutexes[i])->lock();
((BinaryMutex *)(unlockable_mutexes[i] & ~1))->lock();
}
}
}
Expand All @@ -441,7 +441,7 @@ void WorkerThreadPool::_unlock_unlockable_mutexes() {
if ((((uintptr_t)unlockable_mutexes[i]) & 1) == 0) {
((Mutex *)unlockable_mutexes[i])->unlock();
} else {
((BinaryMutex *)unlockable_mutexes[i])->unlock();
((BinaryMutex *)(unlockable_mutexes[i] & ~1))->unlock();
}
}
}
Expand Down

0 comments on commit d6385d7

Please sign in to comment.