mirror of
https://github.com/Ryujinx/libsoundio.git
synced 2025-01-03 20:05:40 +00:00
rt prio warning: fix race condition
This commit is contained in:
parent
20f3f76ef3
commit
1e7cd145ad
13
src/os.cpp
13
src/os.cpp
|
@ -185,13 +185,12 @@ static void *run_pthread(void *userdata) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
static void emit_rtprio_warning(void) {
|
static void emit_rtprio_warning(void) {
|
||||||
static bool seen = false;
|
static atomic_flag seen = ATOMIC_FLAG_INIT;
|
||||||
if (seen)
|
if (!seen.test_and_set()) {
|
||||||
return;
|
fprintf(stderr, "warning: unable to set high priority thread: Operation not permitted\n");
|
||||||
seen = true;
|
fprintf(stderr, "See https://github.com/andrewrk/genesis/wiki/"
|
||||||
fprintf(stderr, "warning: unable to set high priority thread: Operation not permitted\n");
|
"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
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -509,11 +509,12 @@ int soundio_outstream_fill_with_silence(struct SoundIoOutStream *outstream);
|
||||||
int soundio_outstream_free_count(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.
|
// Call this function when you are ready to begin writing to the device buffer.
|
||||||
// `outstream` - (in) The output stream you want to write to.
|
// * `outstream` - (in) The output stream you want to write to.
|
||||||
// `areas` - (out) The memory addresses you can write data to.
|
// * `areas` - (out) The memory addresses you can write data to. It is OK to
|
||||||
// `frame_count` - (in/out) Provide the number of frames you want to write.
|
// modify the pointers if that helps you iterate.
|
||||||
// returned will be the number of frames you actually can write. If this number
|
// * `frame_count` - (in/out) Provide the number of frames you want to write.
|
||||||
// is greater than zero, you must call this function again.
|
// 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,
|
int soundio_outstream_begin_write(struct SoundIoOutStream *outstream,
|
||||||
struct SoundIoChannelArea **areas, int *frame_count);
|
struct SoundIoChannelArea **areas, int *frame_count);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue