diff --git a/src/os.cpp b/src/os.cpp index f0134d3..7eee36e 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -185,13 +185,12 @@ static void *run_pthread(void *userdata) { return NULL; } static void emit_rtprio_warning(void) { - static bool seen = false; - if (seen) - return; - seen = true; - fprintf(stderr, "warning: unable to set high priority thread: Operation not permitted\n"); - fprintf(stderr, "See https://github.com/andrewrk/genesis/wiki/" - "warning:-unable-to-set-high-priority-thread:-Operation-not-permitted\n"); + static atomic_flag seen = ATOMIC_FLAG_INIT; + if (!seen.test_and_set()) { + fprintf(stderr, "warning: unable to set high priority thread: Operation not permitted\n"); + fprintf(stderr, "See https://github.com/andrewrk/genesis/wiki/" + "warning:-unable-to-set-high-priority-thread:-Operation-not-permitted\n"); + } } #endif diff --git a/src/soundio.h b/src/soundio.h index 11ecc6a..22e158b 100644 --- a/src/soundio.h +++ b/src/soundio.h @@ -509,11 +509,12 @@ int soundio_outstream_fill_with_silence(struct SoundIoOutStream *outstream); int soundio_outstream_free_count(struct SoundIoOutStream *outstream); // Call this function when you are ready to begin writing to the device buffer. -// `outstream` - (in) The output stream you want to write to. -// `areas` - (out) The memory addresses you can write data to. -// `frame_count` - (in/out) Provide the number of frames you want to write. -// returned will be the number of frames you actually can write. If this number -// is greater than zero, you must call this function again. +// * `outstream` - (in) The output stream you want to write to. +// * `areas` - (out) The memory addresses you can write data to. It is OK to +// modify the pointers if that helps you iterate. +// * `frame_count` - (in/out) Provide the number of frames you want to write. +// Returned will be the number of frames you actually can write. If this +// number is greater than zero, you must call this function again. int soundio_outstream_begin_write(struct SoundIoOutStream *outstream, struct SoundIoChannelArea **areas, int *frame_count);