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

Comparing libev/ev.c (file contents):
Revision 1.358 by root, Sun Oct 24 14:44:40 2010 UTC vs.
Revision 1.359 by root, Sun Oct 24 17:58:41 2010 UTC

530 530
531static unsigned int noinline 531static unsigned int noinline
532ev_linux_version (void) 532ev_linux_version (void)
533{ 533{
534#ifdef __linux 534#ifdef __linux
535 unsigned int v = 0;
535 struct utsname buf; 536 struct utsname buf;
536 unsigned int v;
537 int i; 537 int i;
538 char *p = buf.release; 538 char *p = buf.release;
539 539
540 if (uname (&buf)) 540 if (uname (&buf))
541 return 0; 541 return 0;
1731#endif 1731#endif
1732 } 1732 }
1733} 1733}
1734 1734
1735/* free up a loop structure */ 1735/* free up a loop structure */
1736static void noinline 1736void
1737loop_destroy (EV_P) 1737ev_loop_destroy (EV_P)
1738{ 1738{
1739 int i; 1739 int i;
1740
1741#if EV_CHILD_ENABLE
1742 if (ev_is_active (&childev))
1743 {
1744 ev_ref (EV_A); /* child watcher */
1745 ev_signal_stop (EV_A_ &childev);
1746 }
1747#endif
1740 1748
1741 if (ev_is_active (&pipe_w)) 1749 if (ev_is_active (&pipe_w))
1742 { 1750 {
1743 /*ev_ref (EV_A);*/ 1751 /*ev_ref (EV_A);*/
1744 /*ev_io_stop (EV_A_ &pipe_w);*/ 1752 /*ev_io_stop (EV_A_ &pipe_w);*/
1812#if EV_ASYNC_ENABLE 1820#if EV_ASYNC_ENABLE
1813 array_free (async, EMPTY); 1821 array_free (async, EMPTY);
1814#endif 1822#endif
1815 1823
1816 backend = 0; 1824 backend = 0;
1825
1826#if EV_MULTIPLICITY
1827 if (ev_is_default_loop (EV_A))
1828#endif
1829 ev_default_loop_ptr = 0;
1830#if EV_MULTIPLICITY
1831 else
1832 ev_free (EV_A);
1833#endif
1817} 1834}
1818 1835
1819#if EV_USE_INOTIFY 1836#if EV_USE_INOTIFY
1820inline_size void infy_fork (EV_P); 1837inline_size void infy_fork (EV_P);
1821#endif 1838#endif
1880 loop_init (EV_A_ flags); 1897 loop_init (EV_A_ flags);
1881 1898
1882 if (ev_backend (EV_A)) 1899 if (ev_backend (EV_A))
1883 return EV_A; 1900 return EV_A;
1884 1901
1902 ev_free (EV_A);
1885 return 0; 1903 return 0;
1886} 1904}
1887 1905
1888void
1889ev_loop_destroy (EV_P)
1890{
1891 loop_destroy (EV_A);
1892 ev_free (loop);
1893}
1894
1895void
1896ev_loop_fork (EV_P)
1897{
1898 postfork = 1; /* must be in line with ev_default_fork */
1899}
1900#endif /* multiplicity */ 1906#endif /* multiplicity */
1901 1907
1902#if EV_VERIFY 1908#if EV_VERIFY
1903static void noinline 1909static void noinline
1904verify_watcher (EV_P_ W w) 1910verify_watcher (EV_P_ W w)
2038 2044
2039 return ev_default_loop_ptr; 2045 return ev_default_loop_ptr;
2040} 2046}
2041 2047
2042void 2048void
2043ev_default_destroy (void) 2049ev_loop_fork (EV_P)
2044{ 2050{
2045#if EV_MULTIPLICITY
2046 EV_P = ev_default_loop_ptr;
2047#endif
2048
2049 ev_default_loop_ptr = 0;
2050
2051#if EV_CHILD_ENABLE
2052 ev_ref (EV_A); /* child watcher */
2053 ev_signal_stop (EV_A_ &childev);
2054#endif
2055
2056 loop_destroy (EV_A);
2057}
2058
2059void
2060ev_default_fork (void)
2061{
2062#if EV_MULTIPLICITY
2063 EV_P = ev_default_loop_ptr;
2064#endif
2065
2066 postfork = 1; /* must be in line with ev_loop_fork */ 2051 postfork = 1; /* must be in line with ev_default_fork */
2067} 2052}
2068 2053
2069/*****************************************************************************/ 2054/*****************************************************************************/
2070 2055
2071void 2056void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines