reentrancy of mieqProcessInputEvents()?

Keith Packard keithp at
Tue Jun 12 17:38:39 PDT 2012

Andy Ritger <aritger at> writes:

> Is mi/mieq.c:mieqProcessInputEvents() expected to be reentrant?  Or should
> mieqProcessInputEvents() never be called in that situation?

It should never be re-entered; probably would be a good idea to check
for that and whinge loudly in the log.

> (g) Someone in the pScrnInfo->SwitchMode wrap chain calls RRTellChanged()
>     (in my case, it is the NVIDIA X driver, but I think many
>     drivers could be exposed to this through xf86SetSingleMode() ->
>     xf86RandR12TellChanged()) which calls UpdateCurrentTime().

This function needs to use UpdateCurrentTimeIf to avoid recursing.

> Making the 'event' variable in mieqProcessInputEvents() non-static
> avoids the FatalError() in FixKeyState(), but is it problematic to
> have the re-entered instance of mieqProcessInputEvents() process events
> from miEventQueue before the first instance of mieqProcessInputEvents()
> has completed processing of its current event?

Yeah, that's not a good plan.

keith.packard at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <>

More information about the xorg-devel mailing list