diff --git a/graphics/src/VHACD/VHACD.h b/graphics/src/VHACD/VHACD.h index 6daec08d..82c9f5ae 100644 --- a/graphics/src/VHACD/VHACD.h +++ b/graphics/src/VHACD/VHACD.h @@ -113,6 +113,12 @@ #include #include +// Local modification done by @iche033 +// The m_voxelHullCount variable type is changed from +// uint32_t to std::atomic +// to fix data race issue picked up by TSAN +#include + #include #include #include @@ -5965,12 +5971,12 @@ class VoxelHull std::unordered_map m_voxelIndexMap; // Maps from a voxel coordinate space into a vertex index space std::vector m_vertices; std::vector m_indices; - static uint32_t m_voxelHullCount; + static std::atomic m_voxelHullCount; IVHACD::Parameters m_params; VHACDCallbacks* m_callbacks{ nullptr }; }; -uint32_t VoxelHull::m_voxelHullCount = 0; +std::atomic VoxelHull::m_voxelHullCount = 0; VoxelHull::VoxelHull(const VoxelHull& parent, SplitAxis axis,