Restore recursive locking for mutexes converted from CRITICAL_SECTION

CRITICAL_SECTION is reentrant; std::mutex is not. This caused deadlocks during world generation, post-processing, and saving.
This commit is contained in:
MatthewBeshay
2026-03-30 22:14:14 +11:00
parent 57e4bdd973
commit e4520df31f
19 changed files with 104 additions and 104 deletions

View File

@@ -198,7 +198,7 @@ bool OldChunkStorage::saveEntities(LevelChunk* lc, Level* level,
ListTag<CompoundTag>* entityTags = new ListTag<CompoundTag>();
{
std::lock_guard<std::mutex> lock(lc->m_csEntities);
std::lock_guard<std::recursive_mutex> lock(lc->m_csEntities);
for (int i = 0; i < lc->ENTITY_BLOCKS_LENGTH; i++) {
auto itEnd = lc->entityBlocks[i]->end();
for (std::vector<std::shared_ptr<Entity> >::iterator it =