MCPcopy Create free account
hub / github.com/3rdparty/libprocess / initialize

Method initialize

src/posix/libev/libev.cpp:83–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81
82
83void EventLoop::initialize()
84{
85 // libev, when built with child process watcher support (the
86 // EV_CHILD_ENABLE feature flag), will install a SIGCHLD handler
87 // and wait on all processes. We need to save and restore the
88 // current signal handler in order to disable this behavior.
89 struct sigaction chldHandler;
90
91 PCHECK(::sigaction(SIGCHLD, nullptr, &chldHandler) == 0);
92
93 loop = ev_default_loop(EVFLAG_AUTO);
94
95 PCHECK(::sigaction(SIGCHLD, &chldHandler, nullptr) == 0);
96
97 ev_async_init(&async_watcher, handle_async);
98 ev_async_init(&shutdown_watcher, handle_shutdown);
99
100 ev_async_start(loop, &async_watcher);
101 ev_async_start(loop, &shutdown_watcher);
102}
103
104
105namespace internal {

Callers

nothing calls this directly

Calls 1

sigactionClass · 0.85

Tested by

no test coverage detected