mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-06-11 19:21:54 +00:00
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:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user