Commit 1f4c4be1 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 90067d16
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,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>
...@@ -70,13 +72,13 @@ struct JackOutput final : AudioOutput { ...@@ -70,13 +72,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