[vlc-devel] [PATCH] bug in globalhotkeys
Rémi Denis-Courmont
remi at remlab.net
Thu Feb 26 13:15:26 CET 2009
On Thu, 26 Feb 2009 12:40:13 +0100, Sébastien Escudier
<sebastien-devel at celeos.eu> wrote:
> - The handler is not vlc's one. It means someone changed it, and I leave
> it as it is.
That won't work.
First, if an error occurs, that someone else should try to handle it. If it
does not handle it, it should forward it to the earlier handler. That means
our now invalid handle (look at what the X11 video output does for
instance) will be called. Second, when that someone else exits, it should
similarly reset the X11 error handler to its own "earlier" value, which was
our handler back then.
If you've used DOS in the old days, you may remember the TSR unload
ordering. We have the same problem here (Xlib is from the eighties
afterall).
> I don't see any case where it doesn't work. If the handler I restore is
> not valid anymore, it is not vlc's responsibility
Yes it is. As long as we are unable to unregister our handler, we MUST
ensure it remains valid. Which means we should sleep until we can
unregister. Unfortunately, that might cause a deadlock.
--
Rémi Denis-Courmont
More information about the vlc-devel
mailing list