From f2f9a6b8a19e14c88636ff9a5bc22599f4e8ec40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Fri, 28 Jun 2024 19:46:55 +0200 Subject: [PATCH] WorkerThreadPool: Fix wrong pointer used in the case of BinaryMutex --- core/object/worker_thread_pool.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/object/worker_thread_pool.cpp b/core/object/worker_thread_pool.cpp index 8f56ca37de3..caf4ed3835a 100644 --- a/core/object/worker_thread_pool.cpp +++ b/core/object/worker_thread_pool.cpp @@ -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(); } } }