Merge pull request #1053 from diizy/banish-all-locks

Banish all locks
This commit is contained in:
Vesa V
2014-08-16 09:58:52 +03:00
15 changed files with 179 additions and 126 deletions

View File

@@ -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>
@@ -138,6 +138,8 @@ private:
f_cnt_t m_rFrames;
sample_t * m_pahdEnv;
sample_t * m_rEnv;
f_cnt_t m_pahdBufSize;
f_cnt_t m_rBufSize;
FloatModel m_lfoPredelayModel;

View File

@@ -231,6 +231,8 @@ private:
QMutex m_notesMutex;
int m_runningMidiNotes[NumKeys];
QMutex m_midiNotesMutex;
bool m_sustainPedalPressed;
bool m_silentBuffersProcessed;

View File

@@ -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;

View File

@@ -276,7 +276,8 @@ private:
// release of note
NotePlayHandleList m_subNotes; // used for chords and arpeggios
volatile bool m_released; // indicates whether note is released
bool m_hasParent;
bool m_hasParent; // indicates whether note has parent
NotePlayHandle * m_parent; // parent note
bool m_hadChildren;
bool m_muted; // indicates whether note is muted
track* m_bbTrack; // related BB track

View File

@@ -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;
} ;

View File

@@ -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;