[libcamera-devel] Potential issue with EventDispatcher

Umang Jain email at uajain.com
Wed Jul 15 10:29:54 CEST 2020


Hi,

I noticed a potential issue where EventDispatcher::processEvents()
is running in a `while` loop, which seems to starve the execution of
any other call to EventDispatcher. Those calls seems to be queued
for execution until processEvents() seems to be terminated in some way
or the other.

I noticed this while studying the guts of Event Loop on Hot-_un_plug
of a currently streaming camera. (Context: see "cam: Add --monitor option"
patch/reviews). On Hot-unplug of a UVC camera, The V4L2VideoDevice tries
to release the buffers and also delete event notifiers. Essentially, 
deleting
event notifiers primarily means to unregister them from Event Dispatcher,
so that the subsequent processEvents call do not process events from the
unregistered event notifiers. However, as I mentioned above, the while loop
in which processEvents is running,  can starve the 
unregisterEventNotifier from
executing (I tried with gdb to hit a breakpoint, but it didn't) .
It's only when I SIGINT cam application, those queued calls on 
unregisterNotifier
are executed.

Is this expected? Or am I missing something.




More information about the libcamera-devel mailing list