Changeset a11817c9ba314e5f4f13d33c24d248f51b6ad2d3

Show
Ignore:
Timestamp:
03/30/08 16:54:20 (5 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1206888860 +0200
git-parent:

[4247f7ce558829ebfb01a888faf53116050c2f33]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1206888538 +0200
Message:

playlist: Use vlc_object_alive().

We can't do what is advised in the documentation of vlc_object_alive(), but we try to stay close enough of it.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/playlist/thread.c

    r4247f7c ra11817c  
    149149    vlc_thread_ready( p_playlist ); 
    150150 
    151     while( !p_playlist->b_die ) 
    152     { 
     151    vlc_object_lock( p_playlist ); 
     152    while( vlc_object_alive( p_playlist ) ) 
     153    { 
     154        vlc_object_unlock( p_playlist ); 
    153155        playlist_MainLoop( p_playlist ); 
     156        vlc_object_lock( p_playlist ); 
     157 
    154158        if( p_playlist->b_cant_sleep ) 
    155159        { 
    156160            /* 100 ms is an acceptable delay for playlist operations */ 
     161            vlc_object_unlock( p_playlist ); 
    157162            msleep( INTF_IDLE_SLEEP*2 ); 
     163            vlc_object_lock( p_playlist ); 
    158164        } 
    159165        else 
    160166        { 
    161             PL_LOCK; 
    162             vlc_bool_t b_die = vlc_object_wait( p_playlist ); 
    163             PL_UNLOCK; 
    164             if( b_die ) 
    165                 break; 
     167            vlc_object_wait( p_playlist ); 
    166168        } 
    167169    } 
     170    vlc_object_unlock( p_playlist ); 
     171 
    168172    playlist_LastLoop( p_playlist ); 
    169173}