13 #ifndef __POSIX_SIGNALHANDLER_HPP__ 14 #define __POSIX_SIGNALHANDLER_HPP__ 33 if (signaledWrapper !=
nullptr) {
34 (*signaledWrapper)(sig, siginfo->si_uid);
44 static std::mutex mutex;
46 synchronized (mutex) {
47 if (signaledWrapper !=
nullptr) {
51 struct sigaction action;
52 memset(&action, 0,
sizeof(
struct sigaction));
54 signaledWrapper =
new std::function<void(int, int)>(*signal);
57 sigemptyset(&action.sa_mask);
61 action.sa_flags = SA_SIGINFO;
65 return sigaction(
SIGUSR1, &action,
nullptr);
73 #endif // __POSIX_SIGNALHANDLER_HPP__
std::function< void(int, int)> * signaledWrapper
Definition: posix_signalhandler.hpp:29
Definition: posix_signalhandler.hpp:23
#define SIGUSR1
Definition: windows_ctrlhandler.hpp:24
Definition: attributes.hpp:24
void signalHandler(int sig, siginfo_t *siginfo, void *context)
Definition: posix_signalhandler.hpp:31
int configureSignal(const std::function< void(int, int)> *signal)
Definition: posix_signalhandler.hpp:39