aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/sighandler/async_signals_handler.h
blob: 8bb44d78a722fd863d8c000d0bd0a849cbf98d3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#pragma once

#include <util/generic/ptr.h>
#include <functional>

struct TEventHandler {
    virtual ~TEventHandler() { 
    } 
    virtual int Handle(int signum) = 0;
};

void SetAsyncSignalHandler(int signum, TAutoPtr<TEventHandler> handler);
void SetAsyncSignalHandler(int signum, void (*handler)(int));
void SetAsyncSignalFunction(int signum, std::function<void(int)> func);