From e649ee28b988894b52f112aa2baabff2e5f444df Mon Sep 17 00:00:00 2001 From: Andrew Bell Date: Tue, 28 Sep 2021 10:03:55 -0400 Subject: [PATCH] Add lock for grabbing chunk location information. Close #76 --- bu/PyramidManager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bu/PyramidManager.cpp b/bu/PyramidManager.cpp index 7942e66..64f7dca 100644 --- a/bu/PyramidManager.cpp +++ b/bu/PyramidManager.cpp @@ -148,6 +148,9 @@ OctantInfo PyramidManager::removeComplete(const VoxelKey& k) // where the chunk should be written. uint64_t PyramidManager::newChunk(const VoxelKey& key, uint32_t size, uint32_t count) { + static std::mutex m; + + std::unique_lock lock(m); return m_copc.newChunk(key, size, count); }