Start work on replacing/removing global locks
This commit is contained in:
@@ -22,8 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _ENVELOPE_AND_LFO_PARAMETERS_H
|
||||
#define _ENVELOPE_AND_LFO_PARAMETERS_H
|
||||
#ifndef ENVELOPE_AND_LFO_PARAMETERS_H
|
||||
#define ENVELOPE_AND_LFO_PARAMETERS_H
|
||||
|
||||
#include <QtCore/QVector>
|
||||
|
||||
|
||||
@@ -231,6 +231,8 @@ private:
|
||||
QMutex m_notesMutex;
|
||||
|
||||
int m_runningMidiNotes[NumKeys];
|
||||
QMutex m_midiNotesMutex;
|
||||
|
||||
bool m_sustainPedalPressed;
|
||||
|
||||
bool m_silentBuffersProcessed;
|
||||
|
||||
@@ -308,6 +308,16 @@ public:
|
||||
{
|
||||
m_inputFramesMutex.unlock();
|
||||
}
|
||||
|
||||
void lockPlayHandleRemoval()
|
||||
{
|
||||
m_playHandleRemovalMutex.lock();
|
||||
}
|
||||
|
||||
void unlockPlayHandleRemoval()
|
||||
{
|
||||
m_playHandleRemovalMutex.unlock();
|
||||
}
|
||||
|
||||
// audio-buffer-mgm
|
||||
void bufferToPort( const sampleFrame * _buf,
|
||||
@@ -449,7 +459,8 @@ private:
|
||||
|
||||
QMutex m_globalMutex;
|
||||
QMutex m_inputFramesMutex;
|
||||
|
||||
|
||||
QMutex m_playHandleRemovalMutex;
|
||||
|
||||
fifo * m_fifo;
|
||||
fifoWriter * m_fifoWriter;
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <QtCore/QThread>
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QMutex>
|
||||
|
||||
#include "ThreadableJob.h"
|
||||
#include "lmms_basics.h"
|
||||
@@ -84,7 +85,18 @@ public:
|
||||
return !isFinished();
|
||||
}
|
||||
|
||||
|
||||
void lock()
|
||||
{
|
||||
m_processingLock.lock();
|
||||
}
|
||||
void unlock()
|
||||
{
|
||||
m_processingLock.unlock();
|
||||
}
|
||||
bool tryLock()
|
||||
{
|
||||
return m_processingLock.tryLock();
|
||||
}
|
||||
virtual void play( sampleFrame* buffer ) = 0;
|
||||
virtual bool isFinished( void ) const = 0;
|
||||
|
||||
@@ -108,6 +120,7 @@ private:
|
||||
Type m_type;
|
||||
f_cnt_t m_offset;
|
||||
const QThread* m_affinity;
|
||||
QMutex m_processingLock;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
{
|
||||
return m_length;
|
||||
}
|
||||
|
||||
|
||||
virtual void movePosition( const MidiTime & _pos );
|
||||
virtual void changeLength( const MidiTime & _length );
|
||||
|
||||
@@ -508,6 +508,18 @@ public:
|
||||
m_height = _height;
|
||||
}
|
||||
|
||||
void lock()
|
||||
{
|
||||
m_processingLock.lock();
|
||||
}
|
||||
void unlock()
|
||||
{
|
||||
m_processingLock.unlock();
|
||||
}
|
||||
bool tryLock()
|
||||
{
|
||||
return m_processingLock.tryLock();
|
||||
}
|
||||
|
||||
public slots:
|
||||
virtual void setName( const QString & _new_name )
|
||||
@@ -533,6 +545,7 @@ private:
|
||||
|
||||
tcoVector m_trackContentObjects;
|
||||
|
||||
QMutex m_processingLock;
|
||||
|
||||
friend class trackView;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user