Merge pull request #961 from diizy/master-atomic
Improve RT-safety by eliminating some global locks
This commit is contained in:
@@ -228,6 +228,8 @@ private:
|
||||
MidiPort m_midiPort;
|
||||
|
||||
NotePlayHandle* m_notes[NumKeys];
|
||||
QMutex m_notesMutex;
|
||||
|
||||
int m_runningMidiNotes[NumKeys];
|
||||
bool m_sustainPedalPressed;
|
||||
|
||||
|
||||
@@ -211,9 +211,9 @@ public:
|
||||
{
|
||||
if( criticalXRuns() == false )
|
||||
{
|
||||
lock();
|
||||
m_playHandles.push_back( handle );
|
||||
unlock();
|
||||
m_playHandleMutex.lock();
|
||||
m_newPlayHandles.append( handle );
|
||||
m_playHandleMutex.unlock();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -428,6 +428,8 @@ private:
|
||||
int m_numWorkers;
|
||||
QWaitCondition m_queueReadyWaitCond;
|
||||
|
||||
PlayHandleList m_newPlayHandles; // place where new playhandles are added temporarily
|
||||
QMutex m_playHandleMutex; // mutex used only for adding playhandles
|
||||
|
||||
PlayHandleList m_playHandles;
|
||||
ConstPlayHandleList m_playHandlesToRemove;
|
||||
|
||||
Reference in New Issue
Block a user