[vlc-commits] input: remove useless lock

Thomas Guillem git at videolan.org
Wed Sep 20 17:38:30 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Sep 20 12:49:55 2017 +0200| [ce3c481d97c64c7fc79927492ed8d125ad39c8f1] | committer: Thomas Guillem

input: remove useless lock

Here, in rdh_sort() (called from readdir_helper_finish()), input items are only
read and can't be used by any other threads since there are not propagated yet
(via input_item_node_PostAndDelete()).

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ce3c481d97c64c7fc79927492ed8d125ad39c8f1
---

 src/input/item.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/src/input/item.c b/src/input/item.c
index f5ba59dd0a..9b2be7286e 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -1351,19 +1351,10 @@ static void rdh_sort(input_item_node_t *p_node)
     if (p_node->i_children <= 0)
         return;
 
-    /* Lock first all children. This avoids to lock/unlock them from each
-     * compar callback call */
-    for (int i = 0; i < p_node->i_children; i++)
-        vlc_mutex_lock(&p_node->pp_children[i]->p_item->lock);
-
     /* Sort current node */
     qsort(p_node->pp_children, p_node->i_children,
           sizeof(input_item_node_t *), rdh_compar_filename);
 
-    /* Unlock all children */
-    for (int i = 0; i < p_node->i_children; i++)
-        vlc_mutex_unlock(&p_node->pp_children[i]->p_item->lock);
-
     /* Sort all children */
     for (int i = 0; i < p_node->i_children; i++)
         rdh_sort(p_node->pp_children[i]);



More information about the vlc-commits mailing list