File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 113113#include < stdint.h>
114114#include < functional>
115115
116+ // Local modification done by @iche033
117+ // The m_voxelHullCount variable type is changed from
118+ // uint32_t to std::atomic<uint32_t>
119+ // to fix data race issue picked up by TSAN
120+ #include < atomic>
121+
116122#include < vector>
117123#include < array>
118124#include < cmath>
@@ -5965,12 +5971,12 @@ class VoxelHull
59655971 std::unordered_map<uint32_t , uint32_t > m_voxelIndexMap; // Maps from a voxel coordinate space into a vertex index space
59665972 std::vector<VHACD::Vertex> m_vertices;
59675973 std::vector<VHACD::Triangle> m_indices;
5968- static uint32_t m_voxelHullCount;
5974+ static std::atomic< uint32_t > m_voxelHullCount;
59695975 IVHACD::Parameters m_params;
59705976 VHACDCallbacks* m_callbacks{ nullptr };
59715977};
59725978
5973- uint32_t VoxelHull::m_voxelHullCount = 0 ;
5979+ std::atomic< uint32_t > VoxelHull::m_voxelHullCount = 0 ;
59745980
59755981VoxelHull::VoxelHull (const VoxelHull& parent,
59765982 SplitAxis axis,
You can’t perform that action at this time.
0 commit comments