macosx playlist: Move one of the lock to avoid a "lock in locked-state" issue.
authorDerk-Jan Hartman <hartman@videolan.org>
Tue, 2 Jun 2009 21:16:01 +0000 (23:16 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Tue, 2 Jun 2009 21:21:10 +0000 (23:21 +0200)
Add a few more lockings around other playlist data as well. We really need to redo all this stuff.

modules/gui/macosx/playlist.m

index 40fb376..4b9275a 100644 (file)
     int i_return = 0;
     playlist_t *p_playlist = pl_Hold( VLCIntf );
 
+    PL_LOCK;
     if( item == nil )
     {
         /* root object */
         if( p_item )
             i_return = p_item->i_children;
     }
+    PL_UNLOCK;
     pl_Release( VLCIntf );
 
     return (i_return >= 0);
         [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++ )
     {
         {
             [o_outline_view expandItem: o_item];
         }
-
     }
 
-    PL_UNLOCK;
     pl_Release( VLCIntf );
 }
 
 
     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
         {
                 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 );
 }