ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.193 by root, Sat Dec 22 05:47:58 2007 UTC vs.
Revision 1.195 by root, Sat Dec 22 11:44:51 2007 UTC

280 280
281typedef ev_watcher *W; 281typedef ev_watcher *W;
282typedef ev_watcher_list *WL; 282typedef ev_watcher_list *WL;
283typedef ev_watcher_time *WT; 283typedef ev_watcher_time *WT;
284 284
285/* sig_atomic_t is used to avoid per-thread variables or locking but still */
286/* giving it a reasonably high chance of working on typical architetcures */
285static int have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work? */ 287static sig_atomic_t have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work? */
286 288
287#ifdef _WIN32 289#ifdef _WIN32
288# include "ev_win32.c" 290# include "ev_win32.c"
289#endif 291#endif
290 292
2264 ev_embed *w = (ev_embed *)(((char *)io) - offsetof (ev_embed, io)); 2266 ev_embed *w = (ev_embed *)(((char *)io) - offsetof (ev_embed, io));
2265 2267
2266 if (ev_cb (w)) 2268 if (ev_cb (w))
2267 ev_feed_event (EV_A_ (W)w, EV_EMBED); 2269 ev_feed_event (EV_A_ (W)w, EV_EMBED);
2268 else 2270 else
2269 ev_embed_sweep (loop, w); 2271 ev_loop (w->other, EVLOOP_NONBLOCK);
2270} 2272}
2271 2273
2272static void 2274static void
2273embed_prepare_cb (EV_P_ ev_prepare *prepare, int revents) 2275embed_prepare_cb (EV_P_ ev_prepare *prepare, int revents)
2274{ 2276{
2275 ev_embed *w = (ev_embed *)(((char *)prepare) - offsetof (ev_embed, prepare)); 2277 ev_embed *w = (ev_embed *)(((char *)prepare) - offsetof (ev_embed, prepare));
2276 2278
2277 fd_reify (w->other); 2279 {
2280 struct ev_loop *loop = w->other;
2281
2282 while (fdchangecnt)
2283 {
2284 fd_reify (EV_A);
2285 ev_loop (EV_A_ EVLOOP_NONBLOCK);
2286 }
2287 }
2278} 2288}
2289
2290#if 0
2291static void
2292embed_idle_cb (EV_P_ ev_idle *idle, int revents)
2293{
2294 ev_idle_stop (EV_A_ idle);
2295}
2296#endif
2279 2297
2280void 2298void
2281ev_embed_start (EV_P_ ev_embed *w) 2299ev_embed_start (EV_P_ ev_embed *w)
2282{ 2300{
2283 if (expect_false (ev_is_active (w))) 2301 if (expect_false (ev_is_active (w)))
2294 2312
2295 ev_prepare_init (&w->prepare, embed_prepare_cb); 2313 ev_prepare_init (&w->prepare, embed_prepare_cb);
2296 ev_set_priority (&w->prepare, EV_MINPRI); 2314 ev_set_priority (&w->prepare, EV_MINPRI);
2297 ev_prepare_start (EV_A_ &w->prepare); 2315 ev_prepare_start (EV_A_ &w->prepare);
2298 2316
2317 /*ev_idle_init (&w->idle, e,bed_idle_cb);*/
2318
2299 ev_start (EV_A_ (W)w, 1); 2319 ev_start (EV_A_ (W)w, 1);
2300} 2320}
2301 2321
2302void 2322void
2303ev_embed_stop (EV_P_ ev_embed *w) 2323ev_embed_stop (EV_P_ ev_embed *w)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines