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
This commit is contained in:
Félix Poisot 2022-05-20 15:29:59 +00:00 committed by Wim Taymans
parent 893567bed6
commit 5daa660a62

View file

@ -5768,17 +5768,21 @@ SPA_EXPORT
int jack_set_sync_timeout (jack_client_t *client, int jack_set_sync_timeout (jack_client_t *client,
jack_time_t timeout) jack_time_t timeout)
{ {
int res = 0;
struct client *c = (struct client *) client; struct client *c = (struct client *) client;
struct pw_node_activation *a; struct pw_node_activation *a;
spa_return_val_if_fail(c != NULL, -EINVAL); spa_return_val_if_fail(c != NULL, -EINVAL);
pw_thread_loop_lock(c->context.loop);
if ((a = c->activation) == NULL) 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 res;
return 0;
} }
SPA_EXPORT SPA_EXPORT