From 5daa660a62817eb29ba0b76bc9ca0b640b289988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Poisot?= Date: Fri, 20 May 2022 15:29:59 +0000 Subject: [PATCH] jack: replace unmatched atomic store with mutex Fixes #1867, as this is the only u64 atomic access in the tree All other accesses to pw_node_activation::sync_timeout are unprotected, so they must assume lock ownership --- pipewire-jack/src/pipewire-jack.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index 8b085529d..4336d1082 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -5768,17 +5768,21 @@ SPA_EXPORT int jack_set_sync_timeout (jack_client_t *client, jack_time_t timeout) { + int res = 0; struct client *c = (struct client *) client; struct pw_node_activation *a; spa_return_val_if_fail(c != NULL, -EINVAL); + pw_thread_loop_lock(c->context.loop); + if ((a = c->activation) == NULL) - return -EIO; + res = -EIO; + else + a->sync_timeout = timeout; + pw_thread_loop_unlock(c->context.loop); - ATOMIC_STORE(a->sync_timeout, timeout); - - return 0; + return res; } SPA_EXPORT