glib main loop


I am doing some development with the glib2.0 main loop (no gtk), or i
am trying to do so, at least.

I want to register a function which is called after each completed
iteration of a main loop. 

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 thought of doing my own main loop and just calling
gmain_context_iteration() like the following:

for (;;) {
  g_main_context_iteration(NULL, TRUE);

Is that the "official" way to achieve this?

Is there any further documentation available about the glib2.0 main
loop? (in addition to

Thank you,

name { Lennart Poettering } mail { lennart poettering de }
icq { 11060553 } www { }
loc { hamburg, germany } pgp { 0x1A015CC4 } hack { .phi. }

Attachment: pgpUv8Yca4YTC.pgp
Description: PGP signature

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