diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2020-05-09 10:53:59 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2020-05-09 10:53:59 +0200 |
commit | 771a146b61f93bd42c1318c22e79d21c293fe82b (patch) | |
tree | 1117a2648c102aca3b2e3ca52bebd2d5cc9c1339 | |
parent | dac7ff97c6b7480e00f20f7021f0b55668b9df6f (diff) |
Replace compare_exchange_strong() with store()
We can write this flag unconditionally. The worker thread only reads it.
-rw-r--r-- | src/util/workerthread.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/util/workerthread.cpp b/src/util/workerthread.cpp index fcfa50282d..defe74726a 100644 --- a/src/util/workerthread.cpp +++ b/src/util/workerthread.cpp @@ -77,12 +77,9 @@ void WorkerThread::suspend() { } void WorkerThread::resume() { + logTrace(m_logger, "Resuming"); // Reset m_suspend to false to allow the thread to make progress. - bool suspended = true; // expected value - // Reset value: true -> false - if (m_suspend.compare_exchange_strong(suspended, false)) { - logTrace(m_logger, "Resuming"); - } + m_suspend.store(false); // Wake up the thread so that it is able to check m_suspend and // continue processing. To avoid race conditions this needs to // be performed unconditionally even if m_suspend was false and has |