1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-06-25 05:25:27 -04:00

GLSpectrum: fixed missing mutex acquisitions wherever the changes flag is set to true

This commit is contained in:
f4exb 2019-08-12 10:35:20 +02:00
parent 07f157272c
commit 895f196fa5

View File

@ -174,6 +174,7 @@ GLSpectrum::~GLSpectrum()
void GLSpectrum::setCenterFrequency(qint64 frequency) void GLSpectrum::setCenterFrequency(qint64 frequency)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_centerFrequency = frequency; m_centerFrequency = frequency;
m_changesPending = true; m_changesPending = true;
update(); update();
@ -181,6 +182,7 @@ void GLSpectrum::setCenterFrequency(qint64 frequency)
void GLSpectrum::setReferenceLevel(Real referenceLevel) void GLSpectrum::setReferenceLevel(Real referenceLevel)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_referenceLevel = referenceLevel; m_referenceLevel = referenceLevel;
m_changesPending = true; m_changesPending = true;
update(); update();
@ -188,6 +190,7 @@ void GLSpectrum::setReferenceLevel(Real referenceLevel)
void GLSpectrum::setPowerRange(Real powerRange) void GLSpectrum::setPowerRange(Real powerRange)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_powerRange = powerRange; m_powerRange = powerRange;
m_changesPending = true; m_changesPending = true;
update(); update();
@ -210,6 +213,7 @@ void GLSpectrum::setHistoStroke(int stroke)
void GLSpectrum::setSampleRate(qint32 sampleRate) void GLSpectrum::setSampleRate(qint32 sampleRate)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_sampleRate = sampleRate; m_sampleRate = sampleRate;
if (m_messageQueueToGUI) { if (m_messageQueueToGUI) {
m_messageQueueToGUI->push(new MsgReportSampleRate(m_sampleRate)); m_messageQueueToGUI->push(new MsgReportSampleRate(m_sampleRate));
@ -220,6 +224,7 @@ void GLSpectrum::setSampleRate(qint32 sampleRate)
void GLSpectrum::setTimingRate(qint32 timingRate) void GLSpectrum::setTimingRate(qint32 timingRate)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_timingRate = timingRate; m_timingRate = timingRate;
m_changesPending = true; m_changesPending = true;
update(); update();
@ -227,6 +232,7 @@ void GLSpectrum::setTimingRate(qint32 timingRate)
void GLSpectrum::setDisplayWaterfall(bool display) void GLSpectrum::setDisplayWaterfall(bool display)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_displayWaterfall = display; m_displayWaterfall = display;
m_changesPending = true; m_changesPending = true;
stopDrag(); stopDrag();
@ -247,6 +253,7 @@ void GLSpectrum::setLsbDisplay(bool lsbDisplay)
void GLSpectrum::setInvertedWaterfall(bool inv) void GLSpectrum::setInvertedWaterfall(bool inv)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_invertedWaterfall = inv; m_invertedWaterfall = inv;
m_changesPending = true; m_changesPending = true;
stopDrag(); stopDrag();
@ -255,6 +262,7 @@ void GLSpectrum::setInvertedWaterfall(bool inv)
void GLSpectrum::setDisplayMaxHold(bool display) void GLSpectrum::setDisplayMaxHold(bool display)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_displayMaxHold = display; m_displayMaxHold = display;
m_changesPending = true; m_changesPending = true;
stopDrag(); stopDrag();
@ -263,6 +271,7 @@ void GLSpectrum::setDisplayMaxHold(bool display)
void GLSpectrum::setDisplayCurrent(bool display) void GLSpectrum::setDisplayCurrent(bool display)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_displayCurrent = display; m_displayCurrent = display;
m_changesPending = true; m_changesPending = true;
stopDrag(); stopDrag();
@ -271,6 +280,7 @@ void GLSpectrum::setDisplayCurrent(bool display)
void GLSpectrum::setDisplayHistogram(bool display) void GLSpectrum::setDisplayHistogram(bool display)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_displayHistogram = display; m_displayHistogram = display;
m_changesPending = true; m_changesPending = true;
stopDrag(); stopDrag();
@ -307,6 +317,7 @@ void GLSpectrum::setDisplayTraceIntensity(int intensity)
void GLSpectrum::setLinear(bool linear) void GLSpectrum::setLinear(bool linear)
{ {
QMutexLocker mutexLocker(&m_mutex);
m_linear = linear; m_linear = linear;
m_changesPending = true; m_changesPending = true;
update(); update();
@ -527,6 +538,7 @@ void GLSpectrum::initializeGL()
void GLSpectrum::resizeGL(int width, int height) void GLSpectrum::resizeGL(int width, int height)
{ {
QMutexLocker mutexLocker(&m_mutex);
QOpenGLFunctions *glFunctions = QOpenGLContext::currentContext()->functions(); QOpenGLFunctions *glFunctions = QOpenGLContext::currentContext()->functions();
glFunctions->glViewport(0, 0, width, height); glFunctions->glViewport(0, 0, width, height);
m_changesPending = true; m_changesPending = true;
@ -1640,6 +1652,7 @@ void GLSpectrum::mouseMoveEvent(QMouseEvent* event)
if (m_cursorState == CSSplitterMoving) if (m_cursorState == CSSplitterMoving)
{ {
QMutexLocker mutexLocker(&m_mutex);
float newShare; float newShare;
if (!m_invertedWaterfall) { if (!m_invertedWaterfall) {
@ -1841,6 +1854,7 @@ void GLSpectrum::tick()
void GLSpectrum::channelMarkerChanged() void GLSpectrum::channelMarkerChanged()
{ {
QMutexLocker mutexLocker(&m_mutex);
m_changesPending = true; m_changesPending = true;
update(); update();
} }
@ -1852,6 +1866,7 @@ void GLSpectrum::channelMarkerDestroyed(QObject* object)
void GLSpectrum::setWaterfallShare(Real waterfallShare) void GLSpectrum::setWaterfallShare(Real waterfallShare)
{ {
QMutexLocker mutexLocker(&m_mutex);
if (waterfallShare < 0.1f) { if (waterfallShare < 0.1f) {
m_waterfallShare = 0.1f; m_waterfallShare = 0.1f;
} }