On Fri, Nov 22, 2013 at 10:04:38PM +0800, Åke Kullenberg 
<ake.kullenb...@gmail.com> wrote:
> However when I run the program the slave thread's call to ev_async_send
> doesn't seem to register. The callback to master_cb_async is never invoked.
> 
> static void slave_cb_timeout(EV_P_ ev_timer *w, int revents) {
>         if (ev_async_pending(&async_to_master) == 0) {
>                 printf("    %s - sending async_send to loop\n", FUNC);
>                 ev_async_send(loop, &async_to_master);

The "loop" you refer to here is the parameter "loop" that EV_P_ declares.

If you change the last line to:

                extern struct ev_loop *loop;
                ev_async_send(loop, &async_to_master);

Then it should work (less ugly solution: rename the outer loop variable to
"loop1").

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

_______________________________________________
libev mailing list
libev@lists.schmorp.de
http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev

Reply via email to