diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.cpp index 20adf1da42..42747cc592 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.cpp @@ -79,11 +79,20 @@ void MemoryCardDriverThreaded::MountThreadMain() while( !m_bShutdownNextUpdate ) { + if( !this->MountThreadWaitForUpdate() ) + continue; + LockMut( m_mutexPause ); // wait until we're unpaused this->MountThreadDoOneUpdate(); } } +bool MemoryCardDriverThreaded::MountThreadWaitForUpdate() +{ + usleep( 100000 ); + return true; +} + bool MemoryCardDriverThreaded::StorageDevicesChanged() { CHECKPOINT; diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.h b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.h index dad7b6a2b6..61848c1acf 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.h +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded.h @@ -33,6 +33,7 @@ protected: void StartThread(); // call this in the derived constructor to start the mounting thread void StopThread(); // call this in the derived desstructor to stop the mounting thread virtual void MountThreadDoOneUpdate() = 0; // this will get called as fast as possible + virtual bool MountThreadWaitForUpdate(); virtual void Mount( UsbStorageDevice* pDevice, CString sMountPoint ) = 0; bool ShouldDoOsMount() { return m_MountThreadState==detect_and_mount; } diff --git a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp index fc64498e63..e07b647dc0 100644 --- a/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp +++ b/stepmania/src/arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp @@ -187,32 +187,29 @@ bool UsbStorageDevicesChanged() return bChanged; } -void MemoryCardDriverThreaded_Linux::MountThreadDoOneUpdate() +/* Return true if MountThreadDoOneUpdate should be called. */ +bool MemoryCardDriverThreaded_Linux::MountThreadWaitForUpdate() { - bool bNeedToDoAnyMounts = false; + /* Check if any devices need a write test. */ for( unsigned i=0; i m_vDevicesLastSeen; };