diff --git a/src/alsa.cpp b/src/alsa.cpp index 27f55d3..d1f675c 100644 --- a/src/alsa.cpp +++ b/src/alsa.cpp @@ -9,7 +9,6 @@ #include "soundio.hpp" #include -#include static snd_pcm_stream_t stream_types[] = {SND_PCM_STREAM_PLAYBACK, SND_PCM_STREAM_CAPTURE}; diff --git a/src/dummy.cpp b/src/dummy.cpp index 2383f7b..da5a871 100644 --- a/src/dummy.cpp +++ b/src/dummy.cpp @@ -10,7 +10,6 @@ #include #include -#include static void playback_thread_run(void *arg) { SoundIoOutStreamPrivate *os = (SoundIoOutStreamPrivate *)arg; diff --git a/src/os.cpp b/src/os.cpp index c23fd65..a6fe689 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -8,14 +8,12 @@ #include "os.h" #include "soundio_private.h" #include "util.hpp" -#include "atomics.hpp" #include #include #include #include #include -#include #if defined(_WIN32) #define SOUNDIO_OS_WINDOWS @@ -125,7 +123,7 @@ static INIT_ONCE win32_init_once = INIT_ONCE_STATIC_INIT; static double win32_time_resolution; static SYSTEM_INFO win32_system_info; #else -static atomic_bool initialized = ATOMIC_VAR_INIT(false); +static bool initialized = false; static pthread_mutex_t init_mutex = PTHREAD_MUTEX_INITIALIZER; #if defined(__MACH__) static clock_serv_t cclock; @@ -586,15 +584,12 @@ int soundio_os_init(void) { if (!InitOnceComplete(&win32_init_once, INIT_ONCE_ASYNC, nullptr)) return SoundIoErrorSystemResources; #else - if (initialized.load()) - return 0; - assert_no_err(pthread_mutex_lock(&init_mutex)); - if (initialized.load()) { + if (initialized) { assert_no_err(pthread_mutex_unlock(&init_mutex)); return 0; } - initialized.store(true); + initialized = true; if ((err = internal_init())) return err; assert_no_err(pthread_mutex_unlock(&init_mutex)); diff --git a/src/pulseaudio.cpp b/src/pulseaudio.cpp index f9511ae..3aea0b6 100644 --- a/src/pulseaudio.cpp +++ b/src/pulseaudio.cpp @@ -9,7 +9,6 @@ #include "soundio.hpp" #include -#include #include