Prefer try-lock in process-callback

This commit is contained in:
Robin Gareus 2023-05-11 18:38:02 +02:00
parent 79e6830d21
commit 57017267cf
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -339,7 +339,12 @@ AudioEngine::process_callback (pframes_t nframes)
}
/* release latency lock, **before** reacquiring process-lock */
ll.release ();
tm.acquire ();
/* this should not be able to fail, but it is good practice
* to only use try-lock in the process callback.
*/
if (!tm.try_acquire ()) {
return 0; // XXX or spin?
}
}
}
}