[vlc-devel] [RFC PATCH 1/5] decoder: fix deadlock when deleting a paused decoder
Rémi Denis-Courmont
remi at remlab.net
Fri Nov 6 17:34:08 CET 2015
On Friday 06 November 2015 14:48:43 Thomas Guillem wrote:
> ---
> src/input/decoder.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index 5f7cc01..daf4479 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -1829,9 +1829,13 @@ void input_DecoderDelete( decoder_t *p_dec )
>
> vlc_cancel( p_owner->thread );
>
> + vlc_fifo_Lock( p_owner->p_fifo );
> + p_owner->paused = false;
> + vlc_fifo_Signal( p_owner->p_fifo );
> + vlc_fifo_Unlock( p_owner->p_fifo );
> +
The thread is already canceled by this point. If it ever waited on the FIFO
condition variable, it would terminate. So this looks like a no-op to me.
In fact, I cannot reproduce any deadlock when stopping during pause.
> /* Make sure we aren't paused/waiting/decoding anymore */
> vlc_mutex_lock( &p_owner->lock );
> - p_owner->paused = false;
This part seems correct.
> p_owner->b_waiting = false;
> p_owner->b_flushing = true;
> vlc_cond_signal( &p_owner->wait_request );
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list