X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/a2417dbac4f1991fb09fe2e0ba96dabdf69c72aa..7657a5620ed7426bb3a1f8142508f9d979ac946a:/ev.c?ds=sidebyside diff --git a/ev.c b/ev.c index 9647e16..1a4e5f1 100644 --- a/ev.c +++ b/ev.c @@ -974,9 +974,13 @@ ev_recommended_backends (void) unsigned int ev_embeddable_backends (void) { + int flags = EVBACKEND_EPOLL | EVBACKEND_KQUEUE | EVBACKEND_PORT; + /* epoll embeddability broken on all linux versions up to at least 2.6.23 */ - return EVBACKEND_KQUEUE - | EVBACKEND_PORT; + /* please fix it and tell me how to detect the fix */ + flags &= ~EVBACKEND_EPOLL; + + return flags; } unsigned int @@ -2268,7 +2272,7 @@ embed_io_cb (EV_P_ ev_io *io, int revents) if (ev_cb (w)) ev_feed_event (EV_A_ (W)w, EV_EMBED); else - ev_embed_sweep (loop, w); + ev_loop (w->other, EVLOOP_NONBLOCK); } static void @@ -2276,8 +2280,24 @@ embed_prepare_cb (EV_P_ ev_prepare *prepare, int revents) { ev_embed *w = (ev_embed *)(((char *)prepare) - offsetof (ev_embed, prepare)); - fd_reify (w->other); + { + struct ev_loop *loop = w->other; + + while (fdchangecnt) + { + fd_reify (EV_A); + ev_loop (EV_A_ EVLOOP_NONBLOCK); + } + } +} + +#if 0 +static void +embed_idle_cb (EV_P_ ev_idle *idle, int revents) +{ + ev_idle_stop (EV_A_ idle); } +#endif void ev_embed_start (EV_P_ ev_embed *w) @@ -2298,6 +2318,8 @@ ev_embed_start (EV_P_ ev_embed *w) ev_set_priority (&w->prepare, EV_MINPRI); ev_prepare_start (EV_A_ &w->prepare); + /*ev_idle_init (&w->idle, e,bed_idle_cb);*/ + ev_start (EV_A_ (W)w, 1); }