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 f6d0310f9c
commit 848c63e2d5
1 changed files with 4 additions and 2 deletions

View File

@ -28,6 +28,8 @@
#include "util/Domain.hxx"
#include "Log.hxx"
#include <atomic>
#include <assert.h>
#include <jack/jack.h>
@ -69,13 +71,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);