Make Modes.exit an atomic_int to make cross-thread use a little simpler.

This commit is contained in:
Oliver Jowett 2020-08-04 20:40:18 +08:00
parent 8734ec9992
commit e8b5be519c
1 changed files with 2 additions and 1 deletions

View File

@ -65,6 +65,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdatomic.h>
#include <pthread.h> #include <pthread.h>
#include <stdint.h> #include <stdint.h>
#include <errno.h> #include <errno.h>
@ -306,7 +307,7 @@ struct _Modes { // Internal state
double sample_rate; // actual sample rate in use (in hz) double sample_rate; // actual sample rate in use (in hz)
uint16_t *log10lut; // Magnitude -> log10 lookup table uint16_t *log10lut; // Magnitude -> log10 lookup table
int exit; // Exit from the main loop when true (2 = unclean exit) atomic_int exit; // Exit from the main loop when true (2 = unclean exit)
// Sample conversion // Sample conversion
int dc_filter; // should we apply a DC filter? int dc_filter; // should we apply a DC filter?