serialize all memory card operations since mount operations hang if we're doing lsusb or reading USB mass storage descriptors in another thread

This commit is contained in:
Chris Danford
2004-10-09 08:16:48 +00:00
parent f8a8294588
commit bc39cb5079
5 changed files with 26 additions and 26 deletions
+9 -4
View File
@@ -232,7 +232,8 @@ void GameState::PlayersFinalized()
m_bPlayersFinalized = true;
MEMCARDMAN->LockCards( true );
MEMCARDMAN->PauseMountingThread();
MEMCARDMAN->LockCards( true ); // this does a mount
// apply saved default modifiers if any
FOREACH_HumanPlayer( pn )
@@ -272,6 +273,7 @@ void GameState::PlayersFinalized()
if( PREFSMAN->m_bMemoryCardsMountOnlyWhenNecessary )
MEMCARDMAN->UnmountAllUsedCards();
MEMCARDMAN->UnPauseMountingThread();
}
/* This data is added to each player profile, and to the machine profile per-player. */
@@ -343,10 +345,9 @@ void GameState::EndGame()
}
}
MEMCARDMAN->PauseMountingThread();
if( PREFSMAN->m_bMemoryCardsMountOnlyWhenNecessary )
MEMCARDMAN->UnmountAllUsedCards();
MEMCARDMAN->MountAllUsedCards();
BOOKKEEPER->WriteToDisk();
PROFILEMAN->SaveAllProfiles();
@@ -359,11 +360,15 @@ void GameState::EndGame()
PROFILEMAN->UnloadProfile( pn );
}
if( PREFSMAN->m_bMemoryCardsMountOnlyWhenNecessary )
MEMCARDMAN->UnmountAllUsedCards();
// Reset the USB storage device numbers -after- saving
CHECKPOINT;
MEMCARDMAN->FlushAndReset();
CHECKPOINT;
SONGMAN->FreeAllLoadedFromProfiles();
// make sure we don't execute EndGame twice.