SignalMonitor: add SignalMonitorGetEventLoop()
Eliminate the global variable "shutdown_loop".
This commit is contained in:
@@ -63,6 +63,8 @@ public:
|
||||
SocketMonitor::Steal();
|
||||
}
|
||||
|
||||
using SocketMonitor::GetEventLoop;
|
||||
|
||||
#ifdef USE_SIGNALFD
|
||||
void Update(sigset_t &mask) {
|
||||
const bool was_open = SocketMonitor::IsDefined();
|
||||
@@ -153,6 +155,12 @@ SignalMonitorFinish()
|
||||
monitor.Destruct();
|
||||
}
|
||||
|
||||
EventLoop &
|
||||
SignalMonitorGetEventLoop()
|
||||
{
|
||||
return monitor->GetEventLoop();
|
||||
}
|
||||
|
||||
void
|
||||
SignalMonitorRegister(int signo, SignalHandler handler)
|
||||
{
|
||||
|
@@ -40,6 +40,13 @@ SignalMonitorInit(EventLoop &loop);
|
||||
void
|
||||
SignalMonitorFinish();
|
||||
|
||||
/**
|
||||
* Obtain a reference to the #EventLoop that was passed to
|
||||
* SignalMonitorInit().
|
||||
*/
|
||||
EventLoop &
|
||||
SignalMonitorGetEventLoop();
|
||||
|
||||
/**
|
||||
* Register a handler for the specified signal. The handler will be
|
||||
* invoked in a safe context.
|
||||
|
Reference in New Issue
Block a user