From 98c825450e1f02b02f3efda8cb1a1f8cafab7fc6 Mon Sep 17 00:00:00 2001 From: akuker Date: Sun, 16 Aug 2020 20:11:56 -0500 Subject: [PATCH] Delay locking the manager until we have a transaction in progress --- src/raspberrypi/rascsi_mgr.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/raspberrypi/rascsi_mgr.cpp b/src/raspberrypi/rascsi_mgr.cpp index 1a1ce78..212641a 100644 --- a/src/raspberrypi/rascsi_mgr.cpp +++ b/src/raspberrypi/rascsi_mgr.cpp @@ -291,7 +291,6 @@ BOOL Rascsi_Manager::Init(){ BOOL Rascsi_Manager::Step() { - m_locked.lock(); // Work initialization m_actid = -1; m_phase = BUS::busfree; @@ -304,7 +303,6 @@ BOOL Rascsi_Manager::Step() m_locked.unlock(); return FALSE; } - m_locked.unlock(); return FALSE; } @@ -316,7 +314,6 @@ BOOL Rascsi_Manager::Step() #if !defined(BAREMETAL) usleep(0); #endif // !BAREMETAL - m_locked.unlock(); return FALSE; } #endif // USE_SEL_EVENT_ENABLE @@ -335,10 +332,10 @@ BOOL Rascsi_Manager::Step() // Stop because it the bus is busy or another device responded if (m_bus->GetBSY() || !m_bus->GetSEL()) { - m_locked.unlock(); return FALSE; } + m_locked.lock(); // Notify all controllers m_data = m_bus->GetDAT(); for (int i = 0; i < CtrlMax; i++) { @@ -403,4 +400,4 @@ void Rascsi_Manager::Stop(){ } BOOL Rascsi_Manager::IsRunning(){ return (m_running == TRUE); -} \ No newline at end of file +}