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

Comparing libev/ev.c (file contents):
Revision 1.339 by root, Tue Mar 16 00:43:22 2010 UTC vs.
Revision 1.342 by root, Mon Mar 29 12:40:57 2010 UTC

435 435
436 436
437/**/ 437/**/
438 438
439#if EV_VERIFY >= 3 439#if EV_VERIFY >= 3
440# define EV_FREQUENT_CHECK ev_loop_verify (EV_A) 440# define EV_FREQUENT_CHECK ev_verify (EV_A)
441#else 441#else
442# define EV_FREQUENT_CHECK do { } while (0) 442# define EV_FREQUENT_CHECK do { } while (0)
443#endif 443#endif
444 444
445/* 445/*
1507#ifdef __APPLE__ 1507#ifdef __APPLE__
1508 /* only select works correctly on that "unix-certified" platform */ 1508 /* only select works correctly on that "unix-certified" platform */
1509 flags &= ~EVBACKEND_KQUEUE; /* horribly broken, even for sockets */ 1509 flags &= ~EVBACKEND_KQUEUE; /* horribly broken, even for sockets */
1510 flags &= ~EVBACKEND_POLL; /* poll is based on kqueue from 10.5 onwards */ 1510 flags &= ~EVBACKEND_POLL; /* poll is based on kqueue from 10.5 onwards */
1511#endif 1511#endif
1512#ifdef __FreeBSD__
1513 flags &= ~EVBACKEND_POLL; /* poll return value is unusable (http://forums.freebsd.org/archive/index.php/t-10270.html) */
1514#endif
1512 1515
1513 return flags; 1516 return flags;
1514} 1517}
1515 1518
1516unsigned int 1519unsigned int
1531 return backend; 1534 return backend;
1532} 1535}
1533 1536
1534#if EV_FEATURE_API 1537#if EV_FEATURE_API
1535unsigned int 1538unsigned int
1536ev_loop_count (EV_P) 1539ev_iteration (EV_P)
1537{ 1540{
1538 return loop_count; 1541 return loop_count;
1539} 1542}
1540 1543
1541unsigned int 1544unsigned int
1542ev_loop_depth (EV_P) 1545ev_depth (EV_P)
1543{ 1546{
1544 return loop_depth; 1547 return loop_depth;
1545} 1548}
1546 1549
1547void 1550void
1868} 1871}
1869#endif 1872#endif
1870 1873
1871#if EV_FEATURE_API 1874#if EV_FEATURE_API
1872void 1875void
1873ev_loop_verify (EV_P) 1876ev_verify (EV_P)
1874{ 1877{
1875#if EV_VERIFY 1878#if EV_VERIFY
1876 int i; 1879 int i;
1877 WL w; 1880 WL w;
1878 1881
2096 EV_FREQUENT_CHECK; 2099 EV_FREQUENT_CHECK;
2097 feed_reverse (EV_A_ (W)w); 2100 feed_reverse (EV_A_ (W)w);
2098 } 2101 }
2099 while (timercnt && ANHE_at (timers [HEAP0]) < mn_now); 2102 while (timercnt && ANHE_at (timers [HEAP0]) < mn_now);
2100 2103
2101 feed_reverse_done (EV_A_ EV_TIMEOUT); 2104 feed_reverse_done (EV_A_ EV_TIMER);
2102 } 2105 }
2103} 2106}
2104 2107
2105#if EV_PERIODIC_ENABLE 2108#if EV_PERIODIC_ENABLE
2106/* make periodics pending */ 2109/* make periodics pending */
2280 EV_INVOKE_PENDING; /* in case we recurse, ensure ordering stays nice and clean */ 2283 EV_INVOKE_PENDING; /* in case we recurse, ensure ordering stays nice and clean */
2281 2284
2282 do 2285 do
2283 { 2286 {
2284#if EV_VERIFY >= 2 2287#if EV_VERIFY >= 2
2285 ev_loop_verify (EV_A); 2288 ev_verify (EV_A);
2286#endif 2289#endif
2287 2290
2288#ifndef _WIN32 2291#ifndef _WIN32
2289 if (expect_false (curpid)) /* penalise the forking check even more */ 2292 if (expect_false (curpid)) /* penalise the forking check even more */
2290 if (expect_false (getpid () != curpid)) 2293 if (expect_false (getpid () != curpid))
3636{ 3639{
3637 struct ev_once *once = (struct ev_once *)ev_malloc (sizeof (struct ev_once)); 3640 struct ev_once *once = (struct ev_once *)ev_malloc (sizeof (struct ev_once));
3638 3641
3639 if (expect_false (!once)) 3642 if (expect_false (!once))
3640 { 3643 {
3641 cb (EV_ERROR | EV_READ | EV_WRITE | EV_TIMEOUT, arg); 3644 cb (EV_ERROR | EV_READ | EV_WRITE | EV_TIMER, arg);
3642 return; 3645 return;
3643 } 3646 }
3644 3647
3645 once->cb = cb; 3648 once->cb = cb;
3646 once->arg = arg; 3649 once->arg = arg;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines