mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
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:
parent
893567bed6
commit
5daa660a62
1 changed files with 8 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue