audio: pipewire: Remove redundant locks The io_list_check_add() and io_list_remove() functions are only ever called from within the Pipewire thread loop, so the locks are redundant. io_list_sort() is called from within a lock in the device detection function, so those additional locks are redundant as well.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
diff --git a/src/audio/pipewire/SDL_pipewire.c b/src/audio/pipewire/SDL_pipewire.c
index 8e48a22..0c1436f 100644
--- a/src/audio/pipewire/SDL_pipewire.c
+++ b/src/audio/pipewire/SDL_pipewire.c
@@ -275,8 +275,6 @@ io_list_check_add(struct io_node *node)
struct io_node *n;
SDL_bool ret = SDL_TRUE;
- PIPEWIRE_pw_thread_loop_lock(hotplug_loop);
-
/* See if the node is already in the list */
spa_list_for_each (n, &hotplug_io_list, link) {
if (n->id == node->id) {
@@ -294,8 +292,6 @@ io_list_check_add(struct io_node *node)
dup_found:
- PIPEWIRE_pw_thread_loop_unlock(hotplug_loop);
-
return ret;
}
@@ -304,8 +300,6 @@ io_list_remove(Uint32 id)
{
struct io_node *n, *temp;
- PIPEWIRE_pw_thread_loop_lock(hotplug_loop);
-
/* Find and remove the node from the list */
spa_list_for_each_safe (n, temp, &hotplug_io_list, link) {
if (n->id == id) {
@@ -320,8 +314,6 @@ io_list_remove(Uint32 id)
break;
}
}
-
- PIPEWIRE_pw_thread_loop_unlock(hotplug_loop);
}
static void
@@ -330,8 +322,6 @@ io_list_sort()
struct io_node *default_sink = NULL, *default_source = NULL;
struct io_node *n, *temp;
- PIPEWIRE_pw_thread_loop_lock(hotplug_loop);
-
/* Find and move the default nodes to the beginning of the list */
spa_list_for_each_safe (n, temp, &hotplug_io_list, link) {
if (n->id == pipewire_default_sink_id) {
@@ -350,8 +340,6 @@ io_list_sort()
if (default_sink) {
spa_list_prepend(&hotplug_io_list, &default_sink->link);
}
-
- PIPEWIRE_pw_thread_loop_unlock(hotplug_loop);
}
static void