Instead of manually pausing and unpausing, automatically pause the
memory card thread when mounting the first drive, and automatically unpause it when we unmount the last drive. (We can do this simplification because we always mount and unmount memory cards explicitly when reading and writing to them.)
This commit is contained in:
@@ -230,8 +230,9 @@ void GameState::PlayersFinalized()
|
||||
|
||||
m_bPlayersFinalized = true;
|
||||
|
||||
MEMCARDMAN->PauseMountingThread();
|
||||
MEMCARDMAN->LockCards();
|
||||
|
||||
/* Mount all available cards, for loading the profile and edits. */
|
||||
MEMCARDMAN->TryMountAllCards();
|
||||
|
||||
// apply saved default modifiers if any
|
||||
@@ -276,7 +277,6 @@ void GameState::PlayersFinalized()
|
||||
}
|
||||
|
||||
MEMCARDMAN->UnmountAllUsedCards();
|
||||
MEMCARDMAN->UnPauseMountingThread();
|
||||
}
|
||||
|
||||
/* This data is added to each player profile, and to the machine profile per-player. */
|
||||
@@ -350,7 +350,6 @@ void GameState::EndGame()
|
||||
}
|
||||
}
|
||||
|
||||
MEMCARDMAN->PauseMountingThread();
|
||||
MEMCARDMAN->MountAllUsedCards();
|
||||
|
||||
BOOKKEEPER->WriteToDisk();
|
||||
@@ -371,8 +370,6 @@ void GameState::EndGame()
|
||||
MEMCARDMAN->FlushAndReset();
|
||||
CHECKPOINT;
|
||||
|
||||
MEMCARDMAN->UnPauseMountingThread();
|
||||
|
||||
SONGMAN->FreeAllLoadedFromProfiles();
|
||||
|
||||
// make sure we don't execute EndGame twice.
|
||||
|
||||
Reference in New Issue
Block a user