From 1d2485382450e3756d70f9de8c48fa7a0a17fdeb Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" <114750+alfredh@users.noreply.github.com> Date: Wed, 19 Jun 2024 09:09:52 +0200 Subject: [PATCH] aumix: add locking in aumix_source_count() --- rem/aumix/aumix.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rem/aumix/aumix.c b/rem/aumix/aumix.c index c3458e425..95032be0c 100644 --- a/rem/aumix/aumix.c +++ b/rem/aumix/aumix.c @@ -399,7 +399,11 @@ uint32_t aumix_source_count(const struct aumix *mix) if (!mix) return 0; - return list_count(&mix->srcl); + mtx_lock(mix->mutex); + uint32_t count = list_count(&mix->srcl); + mtx_unlock(mix->mutex); + + return count; }