From: RĂ©mi Denis-Courmont Date: Tue, 17 Jun 2008 18:43:32 +0000 (+0300) Subject: Remove the last direct use of object_wait X-Git-Tag: 0.9.0-test1~257 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a3e989d4523e9252f53017fd030db87ac5691e00;p=vlc Remove the last direct use of object_wait --- diff --git a/src/libvlc.h b/src/libvlc.h index 0964abdf27..c42058edc7 100644 --- a/src/libvlc.h +++ b/src/libvlc.h @@ -142,6 +142,16 @@ extern void * vlc_custom_create (vlc_object_t *p_this, size_t i_size, int i_type, const char *psz_type); +/* Signal an object without checking for locking consistency. This is wrong. */ +#ifdef __GNUC__ +__attribute__((deprecated)) +#endif +static inline void +vlc_object_signal_maybe (vlc_object_t *p_this) +{ + vlc_cond_signal (&p_this->object_wait); +} + /** * libvlc_global_data_t (global variable) * diff --git a/src/playlist/control.c b/src/playlist/control.c index 41bbf5f696..8051f51f37 100644 --- a/src/playlist/control.c +++ b/src/playlist/control.c @@ -162,7 +162,7 @@ static int PlaylistVAControl( playlist_t * p_playlist, int i_query, va_list args return VLC_EBADVAR; break; } - vlc_cond_signal( &p_playlist->object_wait ); + vlc_object_signal_maybe( VLC_OBJECT(p_playlist) ); return VLC_SUCCESS; } diff --git a/src/playlist/item.c b/src/playlist/item.c index b3c79dd031..20ee6f2e9b 100644 --- a/src/playlist/item.c +++ b/src/playlist/item.c @@ -724,7 +724,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item, else i_ret = TreeMove( p_playlist, p_item, p_node, i_newpos ); p_playlist->b_reset_currently_playing = true; - vlc_cond_signal( &p_playlist->object_wait ); + vlc_object_signal_maybe( VLC_OBJECT(p_playlist) ); return i_ret; } @@ -750,7 +750,7 @@ void playlist_SendAddNotify( playlist_t *p_playlist, int i_item_id, val.p_address = p_add; p_playlist->b_reset_currently_playing = true; if( b_signal ) - vlc_cond_signal( &p_playlist->object_wait ); + vlc_object_signal_maybe( p_playlist ); var_Set( p_playlist, "item-append", val ); free( p_add ); } @@ -808,7 +808,7 @@ static void GoAndPreparse( playlist_t *p_playlist, int i_mode, if( p_playlist->p_input ) input_StopThread( p_playlist->p_input ); p_playlist->request.i_status = PLAYLIST_RUNNING; - vlc_cond_signal( &p_playlist->object_wait ); + vlc_object_signal_maybe( VLC_OBJECT(p_playlist) ); } /* Preparse if PREPARSE or SPREPARSE & not enough meta */ char *psz_artist = input_item_GetArtist( p_item_cat->p_input ); @@ -890,7 +890,7 @@ static int DeleteInner( playlist_t * p_playlist, playlist_item_t *p_item, p_playlist->request.b_request = true; p_playlist->request.p_item = NULL; msg_Info( p_playlist, "stopping playback" ); - vlc_cond_signal( &p_playlist->object_wait ); + vlc_object_signal_maybe( VLC_OBJECT(p_playlist) ); } b_delay_deletion = true; } diff --git a/src/playlist/search.c b/src/playlist/search.c index 207205d4aa..0cd55cadd3 100644 --- a/src/playlist/search.c +++ b/src/playlist/search.c @@ -167,6 +167,6 @@ int playlist_LiveSearchUpdate( playlist_t *p_playlist, playlist_item_t *p_root, { p_playlist->b_reset_currently_playing = true; playlist_LiveSearchUpdateInternal( p_playlist, p_root, psz_string ); - vlc_cond_signal( &p_playlist->object_wait ); + vlc_object_signal_maybe( VLC_OBJECT(p_playlist) ); return VLC_SUCCESS; } diff --git a/src/video_output/vout_intf.c b/src/video_output/vout_intf.c index b3dbe13ac3..2457bbd14c 100644 --- a/src/video_output/vout_intf.c +++ b/src/video_output/vout_intf.c @@ -544,7 +544,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) { msg_Err( p_vout, "Could not get snapshot" ); image_HandlerDelete( p_image ); - vlc_cond_signal( &p_dest->object_wait ); + vlc_object_signal_maybe( VLC_OBJECT(p_dest) ); vlc_object_release( p_dest ); return VLC_EGENERIC; } @@ -556,7 +556,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) { block_Release( p_block ); image_HandlerDelete( p_image ); - vlc_cond_signal( &p_dest->object_wait ); + vlc_object_signal_maybe( VLC_OBJECT(p_dest) ); vlc_object_release( p_dest ); return VLC_ENOMEM; } @@ -573,7 +573,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) block_Release( p_block ); free( p_snapshot ); image_HandlerDelete( p_image ); - vlc_cond_signal( &p_dest->object_wait ); + vlc_object_signal_maybe( VLC_OBJECT(p_dest) ); vlc_object_release( p_dest ); return VLC_ENOMEM; } @@ -584,7 +584,7 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic ) block_Release( p_block ); /* Unlock the object */ - vlc_cond_signal( &p_dest->object_wait ); + vlc_object_signal_maybe( VLC_OBJECT(p_dest) ); vlc_object_release( p_dest ); image_HandlerDelete( p_image );