Merge pull request #93709 from RandomShaper/fix_antilock_bad_mutex

WorkerThreadPool: Fix wrong pointer used in the case of BinaryMutex
This commit is contained in:
Rémi Verschelde 2024-06-29 13:04:09 +02:00
commit d6385d7509
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -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();
}
}
}
@ -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();
}
}
}