move usb reset to the main thread to solve large skip on ScreenEnding
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -25,7 +25,6 @@ public:
|
||||
virtual bool StorageDevicesChanged();
|
||||
virtual void GetStorageDevices( vector<UsbStorageDevice>& 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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -54,7 +54,7 @@ static bool TestWrite( CCStringRef sDrive )
|
||||
return true;
|
||||
}
|
||||
|
||||
void MemoryCardDriverThreaded_Windows::MountThreadReset()
|
||||
void MemoryCardDriverThreaded_Windows::ResetUsbStorage()
|
||||
{
|
||||
m_dwLastLogicalDrives = 0;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user