[vlc-devel] commit: macosx playlist: Move one of the lock to avoid a " lock in locked-state" issue. (Derk-Jan Hartman )

git version control git at videolan.org
Tue Jun 2 23:26:46 CEST 2009


vlc | branch: 1.0-bugfix | Derk-Jan Hartman <hartman at videolan.org> | Tue Jun  2 23:16:01 2009 +0200| [2c064f0dfcf4e538c6c344af6197d1c9c9de27b5] | committer: Derk-Jan Hartman 

macosx playlist: Move one of the lock to avoid a "lock in locked-state" issue.

Add a few more lockings around other playlist data as well. We really need to redo all this stuff.
(cherry picked from commit 03071b8a2a1e61bccc307143b6822a4f08eb1b68)

Signed-off-by: Derk-Jan Hartman <hartman at videolan.org>

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

 modules/gui/macosx/playlist.m |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 58f8262..eb5cd96 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -207,6 +207,7 @@
     int i_return = 0;
     playlist_t *p_playlist = pl_Hold( VLCIntf );
 
+    PL_LOCK;
     if( item == nil )
     {
         /* root object */
@@ -221,6 +222,7 @@
         if( p_item )
             i_return = p_item->i_children;
     }
+    PL_UNLOCK;
     pl_Release( VLCIntf );
 
     return (i_return >= 0);
@@ -583,6 +585,7 @@
         [o_array insertObject: [NSValue valueWithPointer: p_temp_item] atIndex: 0];
         p_temp_item = p_temp_item->p_parent;
     }
+    PL_UNLOCK;
 
     for( j = 0; j < [o_array count] - 1; j++ )
     {
@@ -593,10 +596,8 @@
         {
             [o_outline_view expandItem: o_item];
         }
-
     }
 
-    PL_UNLOCK;
     pl_Release( VLCIntf );
 }
 
@@ -790,12 +791,12 @@
 
     p_item = [[o_outline_view itemAtRow:[o_outline_view selectedRow]] pointerValue];
 
+    PL_LOCK;
     if( p_item )
     {
         if( p_item->i_children == -1 )
         {
             p_node = p_item->p_parent;
-
         }
         else
         {
@@ -809,8 +810,9 @@
                 p_item = NULL;
             }
         }
-        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Unlocked, p_node, p_item );
+        playlist_Control( p_playlist, PLAYLIST_VIEWPLAY, pl_Locked, p_node, p_item );
     }
+    PL_UNLOCK;
     pl_Release( p_intf );
 }
 




More information about the vlc-devel mailing list