]> git.sesse.net Git - vlc/commitdiff
Playlist thread is not cancellable as of now, no point in trying
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 6 Jan 2009 14:25:29 +0000 (16:25 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Tue, 6 Jan 2009 14:25:29 +0000 (16:25 +0200)
src/playlist/playlist_internal.h
src/playlist/thread.c

index a9311530abcbc2f658a298f47724575e7beac097..bf159f4bb6b34e79631e2d0f5551996b196f2dcc 100644 (file)
@@ -82,6 +82,7 @@ typedef struct playlist_private_t
         vlc_mutex_t         lock;     /**< Lock to protect request */
     } request;
 
+    vlc_thread_t thread; /**< engine thread */
     vlc_cond_t signal; /**< wakes up the playlist engine thread */
 
     int      i_last_playlist_id; /**< Last id to an item */
index d3ae00976f9464f08319696fa16bc694a0152996..322e79ef92063e279302404195d7fe3621dad3c8 100644 (file)
@@ -36,7 +36,7 @@
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static void *Thread   ( vlc_object_t * );
+static void *Thread   ( void * );
 
 /*****************************************************************************
  * Main functions for the global thread
@@ -66,8 +66,8 @@ void playlist_Activate( playlist_t *p_playlist )
         msg_Err( p_playlist, "cannot create playlist preparser" );
 
     /* Start the playlist thread */
-    if( vlc_thread_create( p_playlist, "playlist", Thread,
-                           VLC_THREAD_PRIORITY_LOW, false ) )
+    if( vlc_clone( &p_sys->thread, Thread, p_playlist,
+                   VLC_THREAD_PRIORITY_LOW ) )
     {
         msg_Err( p_playlist, "cannot spawn playlist thread" );
     }
@@ -86,7 +86,7 @@ void playlist_Deactivate( playlist_t *p_playlist )
     vlc_cond_signal( &p_sys->signal );
     PL_UNLOCK;
 
-    vlc_thread_join( p_playlist );
+    vlc_join( p_sys->thread, NULL );
     assert( !p_sys->p_input );
 
     PL_LOCK;
@@ -579,11 +579,10 @@ static void LoopRequest( playlist_t *p_playlist )
 /**
  * Run the main control thread itself
  */
-static void *Thread ( vlc_object_t *p_this )
+static void *Thread ( void *data )
 {
-    playlist_t *p_playlist = (playlist_t*)p_this;
+    playlist_t *p_playlist = data;
     playlist_private_t *p_sys = pl_priv(p_playlist);
-    int canc = vlc_savecancel();
 
     vlc_object_lock( p_playlist );
     while( vlc_object_alive( p_playlist ) || p_sys->p_input )
@@ -606,7 +605,6 @@ static void *Thread ( vlc_object_t *p_this )
     }
     vlc_object_unlock( p_playlist );
 
-    vlc_restorecancel (canc);
     return NULL;
 }