unix/SignalHandlers: pass Instance to ...Init()

This commit is contained in:
Max Kellermann 2020-02-17 12:12:38 +01:00
parent 322d6f2a40
commit 29d05cdb8e
3 changed files with 9 additions and 7 deletions

View File

@ -464,7 +464,7 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
#ifndef ANDROID
setup_log_output();
const ScopeSignalHandlersInit signal_handlers_init(instance.event_loop);
const ScopeSignalHandlersInit signal_handlers_init(instance);
#endif
instance.io_thread.Start();

View File

@ -18,13 +18,13 @@
*/
#include "SignalHandlers.hxx"
#include "Instance.hxx"
#include "event/SignalMonitor.hxx"
#ifndef _WIN32
#include "Log.hxx"
#include "LogInit.hxx"
#include "event/Loop.hxx"
#include "system/Error.hxx"
#include "util/Domain.hxx"
@ -56,8 +56,10 @@ handle_reload_event(void *) noexcept
#endif
void
SignalHandlersInit(EventLoop &loop)
SignalHandlersInit(Instance &instance)
{
auto &loop = instance.event_loop;
SignalMonitorInit(loop);
#ifndef _WIN32

View File

@ -20,18 +20,18 @@
#ifndef MPD_SIGNAL_HANDLERS_HXX
#define MPD_SIGNAL_HANDLERS_HXX
class EventLoop;
struct Instance;
void
SignalHandlersInit(EventLoop &loop);
SignalHandlersInit(Instance &instance);
void
SignalHandlersFinish() noexcept;
class ScopeSignalHandlersInit {
public:
ScopeSignalHandlersInit(EventLoop &loop) {
SignalHandlersInit(loop);
ScopeSignalHandlersInit(Instance &instance) {
SignalHandlersInit(instance);
}
~ScopeSignalHandlersInit() noexcept {