From b7f3b59f54aab51687eec9a08a0f88c8c8c040d7 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 5 Apr 2020 01:47:14 +0200 Subject: [PATCH] Removed the mutex from build phase. --- world/voxel_chunk_default.cpp | 11 +---------- world/voxel_chunk_default.h | 1 - 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/world/voxel_chunk_default.cpp b/world/voxel_chunk_default.cpp index fd79427..3c98667 100644 --- a/world/voxel_chunk_default.cpp +++ b/world/voxel_chunk_default.cpp @@ -58,16 +58,10 @@ _FORCE_INLINE_ void VoxelChunkDefault::set_active_build_phase_type(const VoxelCh } bool VoxelChunkDefault::get_build_phase_done() const { - _build_phase_done_mutex->lock(); - bool v = _build_phase_done; - _build_phase_done_mutex->unlock(); - - return v; + return _build_phase_done; } void VoxelChunkDefault::set_build_phase_done(bool value) { - _build_phase_done_mutex->lock(); _build_phase_done = value; - _build_phase_done_mutex->unlock(); } int VoxelChunkDefault::get_lod_size() const { @@ -956,7 +950,6 @@ VoxelChunkDefault::VoxelChunkDefault() { _margin_end = 0; _build_prioritized = false; - _build_phase_done_mutex = Mutex::create(); _build_phase_done = false; _build_thread = NULL; _build_step_in_progress = false; @@ -973,8 +966,6 @@ VoxelChunkDefault::~VoxelChunkDefault() { _abort_build = true; wait_and_finish_thread(); } - - memdelete(_build_phase_done_mutex); } void VoxelChunkDefault::_setup_channels() { diff --git a/world/voxel_chunk_default.h b/world/voxel_chunk_default.h index fb731cb..b94737d 100644 --- a/world/voxel_chunk_default.h +++ b/world/voxel_chunk_default.h @@ -268,7 +268,6 @@ protected: bool _bake_lights; bool _build_prioritized; - Mutex *_build_phase_done_mutex; bool _build_phase_done; Thread *_build_thread; bool _build_step_in_progress;