Re: glib main loop



Lennart Poettering <mz67746b itaparica org> writes: 
> An example: I have a main context with four or five distinct attached
> sources. if any of these get triggered, some cleanup work is needed
> after their execution. If three of them are dispatched in an iteration
> i want to have my cleanup function just called afterwords once.
> 
> is this doable with glib2.0 without quirky hacks?
> 

I believe if you create a custom source type with a "check" function
that returns true if any of your other sources have run, such that
it's dispatched if cleanup is needed, and then attach that source at a
lower priority than the other sources, it will always run after the
other sources and only if cleanup is required.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]