Changeset 21724f580a769fdb2205218bb2e1e1acb8f645b6

Show
Ignore:
Timestamp:
17/09/07 16:29:59 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1190039399 +0000
git-parent:

[8440f6c09557f0f7ba39c5302b93376bcea4a7b1]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1190039399 +0000
Message:

Signal the playlist BEFORE unlocking it.
One should never signal a condition without the corresponding lock:

"if predictable scheduling behavior is required, then that mutex shall

be locked by the thread calling pthread_cond_broadcast()
or pthread_cond_signal()." -- POSIX

This only fixes the most obvious cases. There might be others.

Files:

Legend:

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

    ra73e410 r21724f5  
    185185                 p_playlist->p_preparse->i_waiting, 
    186186                 p_item ); 
     187    vlc_cond_signal( &p_playlist->p_preparse->object_wait ); 
    187188    vlc_mutex_unlock( &p_playlist->p_preparse->object_lock ); 
    188     vlc_cond_signal( &p_playlist->p_preparse->object_wait ); 
    189189    return VLC_SUCCESS; 
    190190} 
     
    219219                 p_playlist->p_fetcher->i_waiting, 
    220220                 i, p ); 
     221    vlc_cond_signal( &p_playlist->p_fetcher->object_wait ); 
    221222    vlc_mutex_unlock( &p_playlist->p_fetcher->object_lock ); 
    222     vlc_cond_signal( &p_playlist->p_fetcher->object_wait ); 
    223223    return VLC_SUCCESS; 
    224224} 
  • src/playlist/engine.c

    r52f8ccc r21724f5  
    545545                             p_playlist->p_fetcher->i_waiting, 
    546546                             p_playlist->p_fetcher->i_waiting, p); 
     547                vlc_cond_signal( &p_playlist->p_fetcher->object_wait ); 
    547548                vlc_mutex_unlock( &p_playlist->p_fetcher->object_lock ); 
    548                 vlc_cond_signal( &p_playlist->p_fetcher->object_wait ); 
    549549            } 
    550550            /* We already have all needed meta, but we need art right now */ 
     
    560560                             p_playlist->p_fetcher->i_waiting, 
    561561                             p_playlist->p_fetcher->i_waiting, p); 
     562                vlc_cond_signal( &p_playlist->p_fetcher->object_wait ); 
    562563                vlc_mutex_unlock( &p_playlist->p_fetcher->object_lock ); 
    563                 vlc_cond_signal( &p_playlist->p_fetcher->object_wait ); 
    564564            } 
    565565            else