mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
jack: take the right locks when modifying globals.
This commit is contained in:
parent
4d7f9c3208
commit
59525b43e6
1 changed files with 4 additions and 0 deletions
|
|
@ -4406,6 +4406,7 @@ int jack_client_close (jack_client_t *client)
|
|||
continue;
|
||||
free_port(c, item->data, false);
|
||||
}
|
||||
pthread_mutex_lock(&globals.lock);
|
||||
spa_list_consume(o, &c->context.objects, link) {
|
||||
bool to_free = o->to_free;
|
||||
spa_list_remove(&o->link);
|
||||
|
|
@ -4413,6 +4414,7 @@ int jack_client_close (jack_client_t *client)
|
|||
o->to_free = to_free;
|
||||
spa_list_append(&globals.free_objects, &o->link);
|
||||
}
|
||||
pthread_mutex_unlock(&globals.lock);
|
||||
|
||||
spa_list_for_each_safe(m, tm, &c->free_mix, link) {
|
||||
if (!m->to_free)
|
||||
|
|
@ -7560,6 +7562,7 @@ static void unreg(void) __attribute__ ((destructor));
|
|||
static void unreg(void)
|
||||
{
|
||||
struct object *o, *to;
|
||||
pthread_mutex_lock(&globals.lock);
|
||||
spa_list_for_each_safe(o, to, &globals.free_objects, link) {
|
||||
if (!o->to_free)
|
||||
spa_list_remove(&o->link);
|
||||
|
|
@ -7568,5 +7571,6 @@ static void unreg(void)
|
|||
spa_list_remove(&o->link);
|
||||
free(o);
|
||||
}
|
||||
pthread_mutex_unlock(&globals.lock);
|
||||
pw_deinit();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue