Suggestion for new watcher type: called immediately after execution of current watcher has finished

Thilo Schulz thilo at
Fri Apr 17 19:48:15 CEST 2015


the software I am currently writing is very modular - with functions in
modules being called directly from the event library, and with modules
having control over when they can be unloaded (this may happen when
a final closing event arrives, and the module then knows it's done and can
I can't simply make the module itself unload from the same call as
the event watcher, because this would of course ruin the callstack.
What I was missing for this case was a way to make libev execute something
immediately after the current watcher is done, even before other pending
watchers are executed.
Instead, I used a prepare watcher, which is close enough for me. (In my
case it doesn't really matter if pending watchers are executed first).

The prepare watcher has its own traps, as I laid out in my prior email.

Best regards,
Thilo Schulz

More information about the libev mailing list