fix: async autosave thread safety and commit path
Move StorageManager.AllocateSaveData() back under the save lock (called on the game thread before releasing). Background thread now only does pure zlib compression with no StorageManager calls. Add CommitPendingAsyncSave() to both the game thread tick and TickCoreSystems() to ensure saves commit during bootstrap, normal gameplay, and shutdown.
This commit is contained in:
@@ -2258,6 +2258,11 @@ void MinecraftServer::tick()
|
||||
PIXBeginNamedEvent(0,"Players tick");
|
||||
players->tick();
|
||||
PIXEndNamedEvent();
|
||||
#if defined(_WINDOWS64)
|
||||
// Commit any pending async autosave on the game thread (same thread
|
||||
// that called Flush/AllocateSaveData, which StorageManager requires).
|
||||
ConsoleSaveFileOriginal::CommitPendingAsyncSave();
|
||||
#endif
|
||||
PIXBeginNamedEvent(0,"Connection tick");
|
||||
connection->tick();
|
||||
PIXEndNamedEvent();
|
||||
|
||||
Reference in New Issue
Block a user