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:
Glenn Maynard
2005-01-27 22:57:18 +00:00
parent d7a279efb9
commit 18b0c5f2d9
4 changed files with 36 additions and 12 deletions
+2 -5
View File
@@ -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.