Commit 211199d8 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

block_FifoEmpty: reduce contention scope

parent eb461c0d
......@@ -508,23 +508,27 @@ void block_FifoRelease( block_fifo_t *p_fifo )
void block_FifoEmpty( block_fifo_t *p_fifo )
{
block_t *b;
block_t *block;
vlc_mutex_lock( &p_fifo->lock );
for( b = p_fifo->p_first; b != NULL; )
block = p_fifo->p_first;
if (block != NULL)
{
block_t *p_next;
p_next = b->p_next;
block_Release( b );
b = p_next;
p_fifo->i_depth = p_fifo->i_size = 0;
p_fifo->p_first = NULL;
p_fifo->pp_last = &p_fifo->p_first;
}
p_fifo->i_depth = p_fifo->i_size = 0;
p_fifo->p_first = NULL;
p_fifo->pp_last = &p_fifo->p_first;
vlc_cond_broadcast( &p_fifo->wait_room );
vlc_mutex_unlock( &p_fifo->lock );
while (block != NULL)
{
block_t *buf;
buf = block->p_next;
block_Release (block);
block = buf;
}
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment