ev_async watcher's callback is never triggering on ev_async_send()

Jonathan Neuschäfer j.neuschaefer at gmx.net
Sun Jun 30 02:27:29 CEST 2013


On Sat, Jun 29, 2013 at 02:50:37PM -0700, trafdev wrote:
> static ev_async async_w;
> 
> static struct ev_loop* dyn_loop;
> 
> void* thread_loop(void* args) {
>     dyn_loop = ev_loop_new(0);
>     ev_async_init(&async_w, async_cb);
>     ev_async_start(dyn_loop, &async_w);
>     ev_run(dyn_loop);
>     int a = 0;
> }
> 
> static ev_async mysig;
> 
> static void timeout_cb(EV_P_ ev_timer *w, int revents) {
>     ev_async_send (dyn_loop, &mysig);

I seems you're using the wrong async watcher here; have you tried
sending the event to async_w instead?


--
Jonathan Neuschäfer



More information about the libev mailing list