LibMedia: Ensure that the PulseAudioContext atexit() call succeeds
Some checks are pending
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Zaggy1024 2025-09-04 12:01:47 -05:00 committed by Jelle Raaijmakers
commit 7811c2e71b
Notes: github-actions[bot] 2025-09-04 17:39:13 +00:00

View file

@ -23,10 +23,13 @@ ErrorOr<NonnullRefPtr<PulseAudioContext>> PulseAudioContext::instance()
static Threading::Mutex instantiation_mutex;
// Lock and unlock the mutex to ensure that the mutex is fully unlocked at application
// exit.
atexit([]() {
auto atexit_result = atexit([]() {
instantiation_mutex.lock();
instantiation_mutex.unlock();
});
if (atexit_result) {
return Error::from_string_literal("Unable to set PulseAudioContext atexit action");
}
auto instantiation_locker = Threading::MutexLocker(instantiation_mutex);