[vlc-devel] [PATCH] wayland: xdg-shell: use roundtrip instead of dispatch

Alexandre Janniaux ajanni at videolabs.io
Mon Apr 6 19:40:14 CEST 2020


Hi,

Oh, right, then what I wrote initially is much better and
it probably needs a flush and a wait condition instead.

I'll rewrite this, thank you for the detailed review!

Regards,
--
Alexandre Janniaux
Videolabs

On Mon, Apr 06, 2020 at 08:10:09PM +0300, Rémi Denis-Courmont wrote:
> Le maanantaina 6. huhtikuuta 2020, 19.50.52 EEST Alexandre Janniaux a écrit :
> > When using wl_display_dispatch, there is a race condition with the main
> > loop, in which the condition `(!sys->wm.configured)` would have been
> > checked as true, but the event dispatched from the main thread after
> > that so wl_display_dispatch would block indefinitely.
> >
> > Said differently, wl_display_dispatch should not be called from a
> > different thread than the main thread (in wayland terms).
>
> That's a bit of code in that file that I did not write so I can believe that
> it's wrong :D but...
>
> > By using wl_display_roundtrip, we let the main thread unblock the
> > vout_window_Enable and prevent this deadlock.
>
> I don't think you can call wl_display_roundtrip outside the main thread, once
> it is running.
>
> The documentation says:
> | This function uses wl_display_dispatch_queue() internally. It is not allowed
> | to call this function while the thread is being prepared for reading events,
> | and doing so will cause a dead lock.
>
> --
> Rémi Denis-Courmont
> Ville neuve de Tapiola, République d´Uusimaa
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list