Skip to content

Commit

Permalink
Removing MUTEX Use
Browse files Browse the repository at this point in the history
Removing Mutex use in not allowed driver areas. Code cleanup.
  • Loading branch information
AmeNote-Michael committed Jul 9, 2024
1 parent dac2c03 commit 43d3570
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/Drivers/USBMIDI2/Driver/StreamEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ Return Value:

// Current mechanism to determine if currently processing data is that
// the StreamEngine is not null. TBD this mechanism needs to be fixed.
auto lock = m_MidiInLock.acquire();
//auto lock = m_MidiInLock.acquire();

if (m_IsRunning)
{
Expand Down Expand Up @@ -579,7 +579,7 @@ StreamEngine::Run()
{
// m_IsRunning is used to indicate running state. If m_IsRunning true, the out worker
// thread will output data to the connected device, otherwise data will be thrown away.
auto lock = m_MidiInLock.acquire();
//auto lock = m_MidiInLock.acquire();

WDFDEVICE devCtx = AcxCircuitGetWdfDevice(AcxPinGetCircuit(m_Pin));
PDEVICE_CONTEXT pDevCtx = GetDeviceContext(devCtx);
Expand Down
2 changes: 0 additions & 2 deletions src/api/Drivers/USBMIDI2/Driver/StreamEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ class StreamEngine
wil::kernel_event_auto_reset m_ThreadExitEvent;
wil::kernel_event_manual_reset m_ThreadExitedEvent {true};

// m_StandardStreamingLock m_LoopbackMessageQueue are only used
// for standard streaming of loopback messages
wil::fast_mutex_with_critical_region m_StandardStreamingLock;
wil::fast_mutex_with_critical_region m_MidiInLock;
LIST_ENTRY m_LoopbackMessageQueue {nullptr};
};

0 comments on commit 43d3570

Please sign in to comment.