async_signals_handler.h 377 B

1234567891011121314
  1. #pragma once
  2. #include <util/generic/ptr.h>
  3. #include <functional>
  4. struct TEventHandler {
  5. virtual ~TEventHandler() {
  6. }
  7. virtual int Handle(int signum) = 0;
  8. };
  9. void SetAsyncSignalHandler(int signum, THolder<TEventHandler> handler);
  10. void SetAsyncSignalHandler(int signum, void (*handler)(int));
  11. void SetAsyncSignalFunction(int signum, std::function<void(int)> func);