Commit 15ce6c62 authored by Jean-Paul Saman's avatar Jean-Paul Saman

block: add locking to block_FifoCount/block_FifoSize

parent a606130b
......@@ -548,14 +548,20 @@ block_t *block_FifoShow( block_fifo_t *p_fifo )
return b;
}
/* FIXME: not thread-safe */
size_t block_FifoSize( const block_fifo_t *p_fifo )
{
return p_fifo->i_size;
size_t i_size;
vlc_mutex_lock( &p_fifo->lock );
i_size = p_fifo->i_size;
vlc_mutex_unlock( &p_fifo->lock );
return i_size;
}
/* FIXME: not thread-safe */
size_t block_FifoCount( const block_fifo_t *p_fifo )
{
return p_fifo->i_depth;
size_t i_depth;
vlc_mutex_lock( &p_fifo->lock );
i_depth = p_fifo->i_depth;
vlc_mutex_unlock( &p_fifo->lock );
return i_depth;
}
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