diff --git a/soundio/soundio.h b/soundio/soundio.h index 09e2c76..567a671 100644 --- a/soundio/soundio.h +++ b/soundio/soundio.h @@ -359,7 +359,8 @@ struct SoundIo { /// This callback is fired when making thread real-time priority failed. By /// default, it will print to stderr only the first time it is called /// a message instructing the user how to configure their system to allow - /// real-time priority threads. + /// real-time priority threads. This must be set to a function not NULL. + /// To silence the warning, assign this to a function that does nothing. void (*emit_rtprio_warning)(void); /// Optional: JACK info callback. diff --git a/src/os.cpp b/src/os.cpp index a6fe689..8f3f8a6 100644 --- a/src/os.cpp +++ b/src/os.cpp @@ -234,7 +234,7 @@ int soundio_os_thread_create( } if ((err = pthread_create(&thread->id, &thread->attr, run_pthread, thread))) { - if (err == EPERM) { + if (err == EPERM && emit_rtprio_warning) { emit_rtprio_warning(); err = pthread_create(&thread->id, NULL, run_pthread, thread); }