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

Without this, the compiler may optimize accesses away.
This commit is contained in:
Max Kellermann 2019-08-04 20:24:51 +02:00
parent 90067d16c0
commit 1f4c4be1f1

View File

@ -27,6 +27,8 @@
#include "util/Domain.hxx"
#include "Log.hxx"
#include <atomic>
#include <assert.h>
#include <jack/jack.h>
@ -70,13 +72,13 @@ struct JackOutput final : AudioOutput {
jack_client_t *client;
jack_ringbuffer_t *ringbuffer[MAX_PORTS];
bool shutdown;
std::atomic_bool shutdown;
/**
* While this flag is set, the "process" callback generates
* silence.
*/
bool pause;
std::atomic_bool pause;
explicit JackOutput(const ConfigBlock &block);