[vlc-commits] input: remove useless lock

Thomas Guillem git at videolan.org
Wed Sep 20 16:57:14 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Sep 20 12:49:55 2017 +0200| [155f4b8a417171e67740c1f9a92e421ea67a3667] | 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=155f4b8a417171e67740c1f9a92e421ea67a3667
---

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

diff --git a/src/input/item.c b/src/input/item.c
index c7ef944f8c..29fa3a7a6a 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