[vlc-devel] [PATCH 17/16] chromecast: the lock mutex is used recursively

Rémi Denis-Courmont remi at remlab.net
Tue May 3 13:47:08 CEST 2016


Le 2016-04-28 16:41, Steve Lhomme a écrit :
> Linux requires vlc_mutex_init_recursive() or crashes
> ---
>  modules/stream_out/chromecast/chromecast_ctrl.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/stream_out/chromecast/chromecast_ctrl.cpp
> b/modules/stream_out/chromecast/chromecast_ctrl.cpp
> index eb490dc..4f45577 100644
> --- a/modules/stream_out/chromecast/chromecast_ctrl.cpp
> +++ b/modules/stream_out/chromecast/chromecast_ctrl.cpp
> @@ -112,7 +112,7 @@ intf_sys_t::intf_sys_t(vlc_object_t * const
> p_this, int port, std::string device
>   , i_requestId(0)
>   , has_input(false)
>  {
> -    vlc_mutex_init(&lock);
> +    vlc_mutex_init_recursive(&lock);
>      vlc_cond_init(&loadCommandCond);

Combination of recursive mutex with condition variables is explicitly 
undefined behaviour.

>
>      // Start the Chromecast event thread.

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list