[vlc-devel] [PATCH 2/2] lib: core: Check refcount from the locked scope

Rémi Denis-Courmont remi at remlab.net
Tue Mar 10 17:28:53 CET 2020


Le tiistaina 10. maaliskuuta 2020, 11.25.21 EET Hugo Beauzée-Luyssen a écrit :
> ---
>  lib/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/core.c b/lib/core.c
> index 56b985f597..1239173710 100644
> --- a/lib/core.c
> +++ b/lib/core.c
> @@ -74,9 +74,9 @@ error:
>  void libvlc_retain( libvlc_instance_t *p_instance )
>  {
>      assert( p_instance != NULL );
> -    assert( p_instance->ref_count < UINT_MAX );
> 
>      vlc_mutex_lock( &p_instance->instance_lock );
> +    assert( p_instance->ref_count < UINT_MAX );
>      p_instance->ref_count++;
>      vlc_mutex_unlock( &p_instance->instance_lock );
>  }

Sure but shouldn't this use an atomic reference counter by now?

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list