Skip to content

Commit

Permalink
- Graph: moved static mutex to instance member.
Browse files Browse the repository at this point in the history
  • Loading branch information
rncbc committed Oct 31, 2023
1 parent d27cd65 commit f317032
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
9 changes: 3 additions & 6 deletions src/qjackctlAlsaGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
//----------------------------------------------------------------------------
// qjackctlAlsaGraph -- ALSA graph driver

QMutex qjackctlAlsaGraph::g_mutex;


// Constructor.
qjackctlAlsaGraph::qjackctlAlsaGraph ( qjackctlGraphCanvas *canvas )
: qjackctlGraphSect(canvas)
Expand Down Expand Up @@ -64,7 +61,7 @@ void qjackctlAlsaGraph::connectPorts (
if (node1 == nullptr || node2 == nullptr)
return;

QMutexLocker locker(&g_mutex);
QMutexLocker locker(&m_mutex);

const int client_id1
= node1->nodeName().section(':', 0, 0).toInt();
Expand Down Expand Up @@ -217,7 +214,7 @@ bool qjackctlAlsaGraph::findClientPort (
// ALSA graph updater.
void qjackctlAlsaGraph::updateItems (void)
{
QMutexLocker locker(&g_mutex);
QMutexLocker locker(&m_mutex);

qjackctlMainForm *pMainForm = qjackctlMainForm::getInstance();
if (pMainForm == nullptr)
Expand Down Expand Up @@ -361,7 +358,7 @@ void qjackctlAlsaGraph::updateItems (void)

void qjackctlAlsaGraph::clearItems (void)
{
QMutexLocker locker(&g_mutex);
QMutexLocker locker(&m_mutex);

#ifdef CONFIG_DEBUG_0
qDebug("qjackctlAlsaGraph::clearItems()");
Expand Down
2 changes: 1 addition & 1 deletion src/qjackctlAlsaGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class qjackctlAlsaGraph : public qjackctlGraphSect
private:

// Notifier sanity mutex.
static QMutex g_mutex;
QMutex m_mutex;
};


Expand Down
9 changes: 3 additions & 6 deletions src/qjackctlJackGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
//----------------------------------------------------------------------------
// qjackctlJackGraph -- JACK graph driver

QMutex qjackctlJackGraph::g_mutex;


#ifdef CONFIG_JACK_METADATA

// JACK client/port meta-data property helpers.
Expand Down Expand Up @@ -199,7 +196,7 @@ void qjackctlJackGraph::connectPorts (
if (node1 == nullptr || node2 == nullptr)
return;

QMutexLocker locker(&g_mutex);
QMutexLocker locker(&m_mutex);

const QByteArray client_port1
= QString(node1->nodeName() + ':' + port1->portName()).toUtf8();
Expand Down Expand Up @@ -400,7 +397,7 @@ bool qjackctlJackGraph::findClientPort ( jack_client_t *client,
// JACK graph updaters.
void qjackctlJackGraph::updateItems (void)
{
QMutexLocker locker(&g_mutex);
QMutexLocker locker(&m_mutex);

qjackctlMainForm *pMainForm = qjackctlMainForm::getInstance();
if (pMainForm == nullptr)
Expand Down Expand Up @@ -499,7 +496,7 @@ void qjackctlJackGraph::updateItems (void)

void qjackctlJackGraph::clearItems (void)
{
QMutexLocker locker(&g_mutex);
QMutexLocker locker(&m_mutex);

#ifdef CONFIG_DEBUG_0
qDebug("qjackctlJackGraph::clearItems()");
Expand Down
2 changes: 1 addition & 1 deletion src/qjackctlJackGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class qjackctlJackGraph : public qjackctlGraphSect
private:

// Callback sanity mutex.
static QMutex g_mutex;
QMutex m_mutex;
};


Expand Down

0 comments on commit f317032

Please sign in to comment.