mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2025-01-03 19:25:32 +00:00
rt prio warning: fix race condition
This commit is contained in:
parent
20f3f76ef3
commit
1e7cd145ad
|
@ -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;
|
||||
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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue