From 5639be5f4fa585a78ef7d68b7d6cb9847b549547 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Mon, 20 Feb 2023 15:38:51 +0000 Subject: [PATCH] BVH - fix lockguards for multithread mode Due to a lack of variable name, the BVH lock guards lifetimes previously did not cover the whole function call. --- core/math/bvh.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/math/bvh.h b/core/math/bvh.h index 4ed369498bb..57362a908dc 100644 --- a/core/math/bvh.h +++ b/core/math/bvh.h @@ -55,7 +55,7 @@ #include "core/os/mutex.h" #define BVHTREE_CLASS BVH_Tree -#define BVH_LOCKED_FUNCTION BVHLockedFunction(&_mutex, BVH_THREAD_SAFE &&_thread_safe); +#define BVH_LOCKED_FUNCTION BVHLockedFunction _lock_guard(&_mutex, BVH_THREAD_SAFE &&_thread_safe); template , class USER_CULL_TEST_FUNCTION = BVH_DummyCullTestFunction, class BOUNDS = AABB, class POINT = Vector3, bool BVH_THREAD_SAFE = true> class BVH_Manager { @@ -776,7 +776,7 @@ private: _mutex = p_mutex; if (_mutex->try_lock() != OK) { - WARN_PRINT("Info : multithread BVH access detected (benign)"); + WARN_PRINT_ONCE("Info : multithread BVH access detected (benign)"); _mutex->lock(); }