Skip to content

Commit d6385d7

Browse files
committed
Merge pull request godotengine#93709 from RandomShaper/fix_antilock_bad_mutex
WorkerThreadPool: Fix wrong pointer used in the case of BinaryMutex
2 parents 0b23be9 + f2f9a6b commit d6385d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/object/worker_thread_pool.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ void WorkerThreadPool::_lock_unlockable_mutexes() {
427427
if ((((uintptr_t)unlockable_mutexes[i]) & 1) == 0) {
428428
((Mutex *)unlockable_mutexes[i])->lock();
429429
} else {
430-
((BinaryMutex *)unlockable_mutexes[i])->lock();
430+
((BinaryMutex *)(unlockable_mutexes[i] & ~1))->lock();
431431
}
432432
}
433433
}
@@ -441,7 +441,7 @@ void WorkerThreadPool::_unlock_unlockable_mutexes() {
441441
if ((((uintptr_t)unlockable_mutexes[i]) & 1) == 0) {
442442
((Mutex *)unlockable_mutexes[i])->unlock();
443443
} else {
444-
((BinaryMutex *)unlockable_mutexes[i])->unlock();
444+
((BinaryMutex *)(unlockable_mutexes[i] & ~1))->unlock();
445445
}
446446
}
447447
}

0 commit comments

Comments
 (0)