Commit 848c63e2 authored by Max Kellermann's avatar Max Kellermann

output/jack: use std::atomic_bool for "shutdown" and "pause"

Without this, the compiler may optimize accesses away.
parent f6d0310f
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#include "util/Domain.hxx" #include "util/Domain.hxx"
#include "Log.hxx" #include "Log.hxx"
#include <atomic>
#include <assert.h> #include <assert.h>
#include <jack/jack.h> #include <jack/jack.h>
...@@ -69,13 +71,13 @@ struct JackOutput final : AudioOutput { ...@@ -69,13 +71,13 @@ struct JackOutput final : AudioOutput {
jack_client_t *client; jack_client_t *client;
jack_ringbuffer_t *ringbuffer[MAX_PORTS]; jack_ringbuffer_t *ringbuffer[MAX_PORTS];
bool shutdown; std::atomic_bool shutdown;
/** /**
* While this flag is set, the "process" callback generates * While this flag is set, the "process" callback generates
* silence. * silence.
*/ */
bool pause; std::atomic_bool pause;
explicit JackOutput(const ConfigBlock &block); explicit JackOutput(const ConfigBlock &block);
......
Markdown is supported
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