Fixed windows deadlocks, performance is shit tho

This commit is contained in:
ImBenji
2025-12-11 17:40:35 +00:00
parent fc7297e0f8
commit 0836935888
2 changed files with 26 additions and 5 deletions

View File

@@ -84,6 +84,9 @@ private:
if (it->second == Mode::Shared && mode == Mode::Exclusive) {
releaseInternal(); // Release the old shared lock
activeLocks.erase(it);
// Small delay to allow OS to process the unlock before re-locking
// This prevents deadlock when multiple threads upgrade simultaneously
Sleep(1);
} else {
// Already hold compatible or same lock
locked = true;