[vlc-devel] commit: Check cond_wait() return value - Fix a deadlock ( Rafaël Carré )

git version control git at videolan.org
Sun Mar 30 16:44:20 CEST 2008


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Sun Mar 30 16:43:54 2008 +0200| [4247f7ce558829ebfb01a888faf53116050c2f33]

Check cond_wait() return value - Fix a deadlock

Remove useless variable

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

 src/playlist/thread.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index 8d2bd71..f0ab752 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -145,14 +145,11 @@ int playlist_ThreadDestroy( playlist_t * p_playlist )
  */
 static void RunControlThread ( playlist_t *p_playlist )
 {
-    int i_loops = 0;
-
     /* Tell above that we're ready */
     vlc_thread_ready( p_playlist );
+
     while( !p_playlist->b_die )
     {
-        i_loops++;
-
         playlist_MainLoop( p_playlist );
         if( p_playlist->b_cant_sleep )
         {
@@ -162,8 +159,10 @@ static void RunControlThread ( playlist_t *p_playlist )
         else
         {
             PL_LOCK;
-            vlc_cond_wait( &p_playlist->object_wait, &p_playlist->object_lock );
+            vlc_bool_t b_die = vlc_object_wait( p_playlist );
             PL_UNLOCK;
+            if( b_die )
+                break;
         }
     }
     playlist_LastLoop( p_playlist );




More information about the vlc-devel mailing list