[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:00 CEST 2009


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Tue Jun  2 23:16:01 2009 +0200| [03071b8a2a1e61bccc307143b6822a4f08eb1b68] | 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.

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

 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 40fb376..4b9275a 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -236,6 +236,7 @@
     int i_return = 0;
     playlist_t *p_playlist = pl_Hold( VLCIntf );
 
+    PL_LOCK;
     if( item == nil )
     {
         /* root object */
@@ -250,6 +251,7 @@
         if( p_item )
             i_return = p_item->i_children;
     }
+    PL_UNLOCK;
     pl_Release( VLCIntf );
 
     return (i_return >= 0);
@@ -642,6 +644,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++ )
     {
@@ -652,10 +655,8 @@
         {
             [o_outline_view expandItem: o_item];
         }
-
     }
 
-    PL_UNLOCK;
     pl_Release( VLCIntf );
 }
 
@@ -849,12 +850,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
         {
@@ -868,8 +869,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