callback never invoked

Marc Lehmann schmorp at schmorp.de
Mon Oct 12 11:51:24 CEST 2020


On Sun, Oct 11, 2020 at 04:51:09PM +0500, rustahm <rustahm at gmail.com> wrote:
> Please find attached the source code. Could anyone explain why the callback
> is never invoked when I do change the files?

You probably never call ev's mainloop: you only call ev::run once with
NOWAIT, so unless any change happens before that call, libev code is never
invoked and therefore does not have a chance of calling your callback.

You would need to put something like ev_run (EV_A_ 0) into your main program
(which you haven't shown).

Also, ev::get_default_loop() (and .run) is internal undocumented
functionality which you should not call if you want your program to
continue to work with future versions.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list