Commit 32beb563 authored by Thomas Eschenbacher's avatar Thomas Eschenbacher
Browse files

fixed deprecation warnings: now make use of QRecursiveMutex

parent bb6b490f
......@@ -3,6 +3,7 @@
* introduced Kwave::URLfromUserInput to work around problems with QUrl
misinterpreting file names in cmdline parameters as http:// URLs
* fixed deprecation warnings: use QRecursiveMutex
20.08.01 [2020-08-31]
......
......@@ -43,7 +43,7 @@ Kwave::OverViewCache::OverViewCache(Kwave::SignalManager &signal,
m_selection(&signal, src_offset, src_length, src_tracks),
m_min(), m_max(), m_state(), m_minmax(),
m_scale(1),
m_lock(QMutex::Recursive)
m_lock()
{
connect(&m_selection, SIGNAL(sigTrackInserted(QUuid)),
......
......@@ -24,8 +24,8 @@
#include <QHash>
#include <QImage>
#include <QList>
#include <QMutex>
#include <QObject>
#include <QRecursiveMutex>
#include <QUuid>
#include <QVector>
......@@ -194,7 +194,7 @@ namespace Kwave
quint64 m_scale;
/** mutex for threadsafe access to the cache */
QMutex m_lock;
QRecursiveMutex m_lock;
};
}
......
......@@ -34,7 +34,7 @@ Kwave::SelectionTracker::SelectionTracker(Kwave::SignalManager *signal,
m_length((length || !signal) ? length : signal->length()),
m_tracks(),
m_selection_only((length != 0)),
m_lock(QMutex::Recursive)
m_lock()
{
Q_ASSERT(signal);
if (!signal) return;
......
......@@ -24,6 +24,7 @@
#include <QList>
#include <QObject>
#include <QPointer>
#include <QRecursiveMutex>
#include <QUuid>
#include <QVector>
......@@ -308,7 +309,7 @@ namespace Kwave
bool m_selection_only;
/** mutex for threadsafe access to the selection */
QMutex m_lock;
QRecursiveMutex m_lock;
};
}
......
......@@ -84,7 +84,7 @@ Kwave::Plugin::Plugin(QObject *parent, const QVariantList &args)
m_usage_lock(),
m_progress_timer(),
m_current_progress(-1),
m_progress_lock(QMutex::Recursive)
m_progress_lock()
{
// check: this must be called from the GUI thread only!
Q_ASSERT(this->thread() == QThread::currentThread());
......
......@@ -25,6 +25,7 @@
#include <QList>
#include <QMutex>
#include <QObject>
#include <QRecursiveMutex>
#include <QString>
#include <QThread>
#include <QTimer>
......@@ -395,7 +396,7 @@ namespace Kwave
qreal m_current_progress;
/** Mutex for locking the progress bar */
QMutex m_progress_lock;
QRecursiveMutex m_progress_lock;
};
......
......@@ -22,7 +22,7 @@
//***************************************************************************
Kwave::SampleFIFO::SampleFIFO()
:m_buffer(), m_size(0), m_read_offset(0), m_lock(QMutex::Recursive)
:m_buffer(), m_size(0), m_read_offset(0), m_lock()
{
}
......@@ -30,7 +30,7 @@ Kwave::SampleFIFO::SampleFIFO()
Kwave::SampleFIFO::SampleFIFO(const Kwave::SampleFIFO &other)
:m_buffer(other.m_buffer), m_size(other.m_size),
m_read_offset(other.m_read_offset),
m_lock(QMutex::Recursive)
m_lock()
{
}
......
......@@ -22,8 +22,8 @@
#include <QtGlobal>
#include <QList>
#include <QMutex>
#include <QQueue>
#include <QRecursiveMutex>
#include "libkwave/SampleArray.h"
......@@ -107,7 +107,7 @@ namespace Kwave
sample_index_t m_read_offset;
/** mutex for access to the FIFO (recursive) */
QMutex m_lock;
QRecursiveMutex m_lock;
};
}
......
......@@ -89,7 +89,7 @@ Kwave::SignalManager::SignalManager(QWidget *parent)
m_redo_buffer(),
m_undo_transaction(Q_NULLPTR),
m_undo_transaction_level(0),
m_undo_transaction_lock(QMutex::Recursive),
m_undo_transaction_lock(),
m_meta_data()
{
// connect to the track's signals
......
......@@ -23,8 +23,8 @@
#include <QtGlobal>
#include <QList>
#include <QMap>
#include <QMutex>
#include <QObject>
#include <QRecursiveMutex>
#include <QString>
#include "libkwave/FileInfo.h"
......@@ -757,7 +757,7 @@ namespace Kwave
unsigned int m_undo_transaction_level;
/** mutex for locking undo transactions */
QMutex m_undo_transaction_lock;
QRecursiveMutex m_undo_transaction_lock;
/** Manager for undo/redo actions */
Kwave::UndoManager m_undo_manager;
......
......@@ -56,14 +56,14 @@
//***************************************************************************
Kwave::Track::Track()
:m_lock(QMutex::Recursive), m_lock_usage(), m_stripes(), m_selected(true),
:m_lock(), m_lock_usage(), m_stripes(), m_selected(true),
m_uuid(QUuid::createUuid())
{
}
//***************************************************************************
Kwave::Track::Track(sample_index_t length, QUuid *uuid)
:m_lock(QMutex::Recursive), m_lock_usage(), m_stripes(), m_selected(true),
:m_lock(), m_lock_usage(), m_stripes(), m_selected(true),
m_uuid((uuid) ? *uuid : QUuid::createUuid())
{
if (length <= STRIPE_LENGTH_MAXIMUM) {
......
......@@ -22,9 +22,9 @@
#include <QtGlobal>
#include <QList>
#include <QMutex>
#include <QObject>
#include <QReadWriteLock>
#include <QRecursiveMutex>
#include <QUuid>
#include "libkwave/InsertMode.h"
......@@ -304,7 +304,7 @@ namespace Kwave
private:
/** lock for access to the whole track */
QMutex m_lock;
QRecursiveMutex m_lock;
/** lock to protect against deletion while the track is in use */
QReadWriteLock m_lock_usage;
......
......@@ -28,7 +28,7 @@ bool Kwave::StreamObject::m_interactive = false;
//***************************************************************************
Kwave::StreamObject::StreamObject(QObject *parent)
:QObject(Q_NULLPTR /*parent*/),
m_lock_set_attribute(QMutex::Recursive),
m_lock_set_attribute(),
m_canceled(false)
{
Q_UNUSED(parent)
......
......@@ -21,8 +21,8 @@
#include "config.h"
#include <QtGlobal>
#include <QMutex>
#include <QObject>
#include <QRecursiveMutex>
class QVariant;
......@@ -138,7 +138,7 @@ namespace Kwave
private:
/** Mutex for locking access to setAttribute (recursive) */
QMutex m_lock_set_attribute;
QRecursiveMutex m_lock_set_attribute;
/** interactive mode: if enabled, use smaller block size */
static bool m_interactive;
......
......@@ -46,7 +46,7 @@
//***************************************************************************
Kwave::PlayBackQt::PlayBackQt()
:QObject(), Kwave::PlayBackDevice(),
m_lock(QMutex::NonRecursive),
m_lock(),
m_device_name_map(),
m_available_devices(),
m_output(Q_NULLPTR),
......@@ -457,7 +457,7 @@ int Kwave::PlayBackQt::detectChannels(const QString &device,
//***************************************************************************
Kwave::PlayBackQt::Buffer::Buffer()
:QIODevice(),
m_lock(QMutex::Recursive),
m_lock(),
m_sem_free(0),
m_sem_filled(0),
m_raw_buffer(),
......
......@@ -30,6 +30,7 @@
#include <QMutex>
#include <QObject>
#include <QQueue>
#include <QRecursiveMutex>
#include <QSemaphore>
#include <QString>
......@@ -194,7 +195,7 @@ namespace Kwave
private:
/** mutex for locking the queue */
QMutex m_lock;
QRecursiveMutex m_lock;
/** semaphore with free buffer space */
QSemaphore m_sem_free;
......
......@@ -61,7 +61,7 @@
Kwave::RecordQt::RecordQt()
:QObject(Q_NULLPTR),
Kwave::RecordDevice(),
m_lock(QMutex::Recursive),
m_lock(),
m_device_name_map(),
m_available_devices(),
m_input(Q_NULLPTR),
......
......@@ -24,7 +24,7 @@
#include <QAudio>
#include <QAudioDeviceInfo>
#include <QList>
#include <QMutex>
#include <QRecursiveMutex>
#include <QSemaphore>
#include <QString>
#include <QStringList>
......@@ -237,7 +237,7 @@ namespace Kwave
private:
/** mutex for locking the streaming thread against main thread */
QMutex m_lock;
QRecursiveMutex m_lock;
/**
* dictionary for translating verbose device names
......
......@@ -28,7 +28,7 @@
//***************************************************************************
Kwave::RecordThread::RecordThread()
:Kwave::WorkerThread(Q_NULLPTR, QVariant()),
m_lock(QMutex::Recursive),
m_lock(),
m_device(Q_NULLPTR),
m_empty_queue(),
m_full_queue(),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment