[vlc-commits] input: remove recursive locking in input_item_node_AppendItem()

Thomas Guillem git at videolan.org
Tue May 3 18:38:19 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue May  3 18:35:50 2016 +0200| [2edb4cb6046cc4aed1d6b7f4bb6958276994b694] | committer: Thomas Guillem

input: remove recursive locking in input_item_node_AppendItem()

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

 src/input/item.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/input/item.c b/src/input/item.c
index dd8622b..0dfb820 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -1159,13 +1159,14 @@ input_item_node_t *input_item_node_AppendItem( input_item_node_t *p_node, input_
     if( !p_new_child ) return NULL;
 
     vlc_mutex_lock( &p_node->p_item->lock );
-    vlc_mutex_lock( &p_item->lock );
     i_preparse_depth = p_node->p_item->i_preparse_depth;
+    vlc_mutex_unlock( &p_node->p_item->lock );
+
+    vlc_mutex_lock( &p_item->lock );
     p_item->i_preparse_depth = i_preparse_depth > 0 ?
                                i_preparse_depth -1 :
                                i_preparse_depth;
     vlc_mutex_unlock( &p_item->lock );
-    vlc_mutex_unlock( &p_node->p_item->lock );
 
     input_item_node_AppendNode( p_node, p_new_child );
     return p_new_child;



More information about the vlc-commits mailing list