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

Comparing libev/ev.c (file contents):
Revision 1.56 by root, Sun Nov 4 15:58:49 2007 UTC vs.
Revision 1.59 by root, Sun Nov 4 18:15:16 2007 UTC

58 58
59#ifndef EV_USE_SELECT 59#ifndef EV_USE_SELECT
60# define EV_USE_SELECT 1 60# define EV_USE_SELECT 1
61#endif 61#endif
62 62
63#ifndef EV_USEV_POLL 63#ifndef EV_USE_POLL
64# define EV_USEV_POLL 0 /* poll is usually slower than select, and not as well tested */ 64# define EV_USE_POLL 0 /* poll is usually slower than select, and not as well tested */
65#endif 65#endif
66 66
67#ifndef EV_USE_EPOLL 67#ifndef EV_USE_EPOLL
68# define EV_USE_EPOLL 0 68# define EV_USE_EPOLL 0
69#endif 69#endif
409static ANSIG *signals; 409static ANSIG *signals;
410static int signalmax; 410static int signalmax;
411 411
412static int sigpipe [2]; 412static int sigpipe [2];
413static sig_atomic_t volatile gotsig; 413static sig_atomic_t volatile gotsig;
414static struct ev_io sigev;
414 415
415static void 416static void
416signals_init (ANSIG *base, int count) 417signals_init (ANSIG *base, int count)
417{ 418{
418 while (count--) 419 while (count--)
475} 476}
476 477
477/*****************************************************************************/ 478/*****************************************************************************/
478 479
479#ifndef WIN32 480#ifndef WIN32
481
482static struct ev_child *childs [PID_HASHSIZE];
483static struct ev_signal childev;
480 484
481#ifndef WCONTINUED 485#ifndef WCONTINUED
482# define WCONTINUED 0 486# define WCONTINUED 0
483#endif 487#endif
484 488
520# include "ev_kqueue.c" 524# include "ev_kqueue.c"
521#endif 525#endif
522#if EV_USE_EPOLL 526#if EV_USE_EPOLL
523# include "ev_epoll.c" 527# include "ev_epoll.c"
524#endif 528#endif
525#if EV_USEV_POLL 529#if EV_USE_POLL
526# include "ev_poll.c" 530# include "ev_poll.c"
527#endif 531#endif
528#if EV_USE_SELECT 532#if EV_USE_SELECT
529# include "ev_select.c" 533# include "ev_select.c"
530#endif 534#endif
588 if (!method && (methods & EVMETHOD_KQUEUE)) method = kqueue_init (EV_A_ methods); 592 if (!method && (methods & EVMETHOD_KQUEUE)) method = kqueue_init (EV_A_ methods);
589#endif 593#endif
590#if EV_USE_EPOLL 594#if EV_USE_EPOLL
591 if (!method && (methods & EVMETHOD_EPOLL )) method = epoll_init (EV_A_ methods); 595 if (!method && (methods & EVMETHOD_EPOLL )) method = epoll_init (EV_A_ methods);
592#endif 596#endif
593#if EV_USEV_POLL 597#if EV_USE_POLL
594 if (!method && (methods & EVMETHOD_POLL )) method = poll_init (EV_A_ methods); 598 if (!method && (methods & EVMETHOD_POLL )) method = poll_init (EV_A_ methods);
595#endif 599#endif
596#if EV_USE_SELECT 600#if EV_USE_SELECT
597 if (!method && (methods & EVMETHOD_SELECT)) method = select_init (EV_A_ methods); 601 if (!method && (methods & EVMETHOD_SELECT)) method = select_init (EV_A_ methods);
598#endif 602#endif
606 if (method == EVMETHOD_KQUEUE) kqueue_destroy (EV_A); 610 if (method == EVMETHOD_KQUEUE) kqueue_destroy (EV_A);
607#endif 611#endif
608#if EV_USE_EPOLL 612#if EV_USE_EPOLL
609 if (method == EVMETHOD_EPOLL ) epoll_destroy (EV_A); 613 if (method == EVMETHOD_EPOLL ) epoll_destroy (EV_A);
610#endif 614#endif
611#if EV_USEV_POLL 615#if EV_USE_POLL
612 if (method == EVMETHOD_POLL ) poll_destroy (EV_A); 616 if (method == EVMETHOD_POLL ) poll_destroy (EV_A);
613#endif 617#endif
614#if EV_USE_SELECT 618#if EV_USE_SELECT
615 if (method == EVMETHOD_SELECT) select_destroy (EV_A); 619 if (method == EVMETHOD_SELECT) select_destroy (EV_A);
616#endif 620#endif
707} 711}
708 712
709void 713void
710ev_default_destroy (void) 714ev_default_destroy (void)
711{ 715{
716#if EV_MULTIPLICITY
712 struct ev_loop *loop = default_loop; 717 struct ev_loop *loop = default_loop;
718#endif
713 719
714 ev_ref (EV_A); /* child watcher */ 720 ev_ref (EV_A); /* child watcher */
715 ev_signal_stop (EV_A_ &childev); 721 ev_signal_stop (EV_A_ &childev);
716 722
717 ev_ref (EV_A); /* signal watcher */ 723 ev_ref (EV_A); /* signal watcher */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines