diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.cpp index da0335d710..9c90fe362d 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.cpp @@ -25,7 +25,6 @@ MemoryCardDriverThreaded::MemoryCardDriverThreaded() : m_mutexStorageDevices("StorageDevices") { m_bShutdownNextUpdate = false; - m_bResetNextUpdate = false; m_bStorageDevicesChanged = false; } @@ -64,11 +63,6 @@ void MemoryCardDriverThreaded::MountThreadMain() while( !m_bShutdownNextUpdate ) { LockMut( m_mutexPause ); // wait until we're unpaused - if( m_bResetNextUpdate ) - { - this->MountThreadReset(); - m_bResetNextUpdate = false; - } this->MountThreadDoOneUpdate(); } } @@ -112,11 +106,6 @@ bool MemoryCardDriverThreaded::MountAndTestWrite( UsbStorageDevice* pDevice, CSt return true; } -void MemoryCardDriverThreaded::ResetUsbStorage() -{ - m_bResetNextUpdate = true; -} - /* * (c) 2003-2004 Chris Danford * All rights reserved. diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.h b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.h index 551712aca3..d43aa5b9ec 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.h +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.h @@ -25,7 +25,6 @@ public: virtual bool StorageDevicesChanged(); virtual void GetStorageDevices( vector& vStorageDevicesOut ); virtual bool MountAndTestWrite( UsbStorageDevice* pDevice, CString sMountPoint ); - virtual void ResetUsbStorage(); virtual void PauseMountingThread(); virtual void UnPauseMountingThread(); @@ -35,7 +34,6 @@ private: RageThread m_threadMemoryCardMount; bool m_bShutdownNextUpdate; - bool m_bResetNextUpdate; // Aquire this before detecting devices or reading/writing devices. // Calling Pause() and Unpause will lock/unlock this so that the mounting thread @@ -44,7 +42,6 @@ private: protected: void StartThread(); // call this in the derived constructor to start the mounting thread - virtual void MountThreadReset() = 0; virtual void MountThreadDoOneUpdate() = 0; // this will get called as fast as possible virtual void Mount( UsbStorageDevice* pDevice, CString sMountPoint ) = 0; diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp index 3cb7caae76..a64238c0a5 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp @@ -135,7 +135,7 @@ MemoryCardDriverThreaded_Linux::MemoryCardDriverThreaded_Linux() this->StartThread(); } -void MemoryCardDriverThreaded_Linux::MountThreadReset() +void MemoryCardDriverThreaded_Linux::ResetUsbStorage() { // // if usb-storage gets in a bad state, resetting usb-storage will sometimes fix it. @@ -158,6 +158,8 @@ void MemoryCardDriverThreaded_Linux::MountThreadReset() m_vDevicesLastSeen.clear(); m_bForceRedetect = true; + + MountThreadDoOneUpdate(); } void MemoryCardDriverThreaded_Linux::MountThreadDoOneUpdate() @@ -167,7 +169,7 @@ void MemoryCardDriverThreaded_Linux::MountThreadDoOneUpdate() if( m_bForceRedetect ) { - m_bForceRedetect = false; + m_bForceRedetect = false; // fall through } else diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.h b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.h index c14d1a98ea..c96e044035 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.h +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.h @@ -12,7 +12,7 @@ public: virtual void Flush( UsbStorageDevice* pDevice ); protected: virtual void Mount( UsbStorageDevice* pDevice, CString sMountPoint ); - virtual void MountThreadReset(); + virtual void ResetUsbStorage(); virtual void MountThreadDoOneUpdate(); int m_fd; diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp index 1325c478de..78f8cbc24d 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp @@ -54,7 +54,7 @@ static bool TestWrite( CCStringRef sDrive ) return true; } -void MemoryCardDriverThreaded_Windows::MountThreadReset() +void MemoryCardDriverThreaded_Windows::ResetUsbStorage() { m_dwLastLogicalDrives = 0; } diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.h b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.h index 4ac398f714..374856d39e 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.h +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Windows.h @@ -13,7 +13,7 @@ public: virtual void Flush( UsbStorageDevice* pDevice ); protected: virtual void Mount( UsbStorageDevice* pDevice, CString sMountPoint ); - virtual void MountThreadReset(); + virtual void ResetUsbStorage(); virtual void MountThreadDoOneUpdate(); DWORD m_dwLastLogicalDrives;