13 #ifndef __WINDOWS_CTRLHANDLER_HPP__ 14 #define __WINDOWS_CTRLHANDLER_HPP__ 33 switch (fdwCtrlType) {
36 case CTRL_CLOSE_EVENT:
37 case CTRL_BREAK_EVENT:
38 case CTRL_LOGOFF_EVENT:
39 case CTRL_SHUTDOWN_EVENT: {
40 if (signaledWrapper !=
nullptr) {
57 static std::mutex mutex;
59 synchronized (mutex) {
60 if (signaledWrapper !=
nullptr) {
64 if (signal !=
nullptr) {
65 signaledWrapper =
new std::function<void(int, int)>(*signal);
69 signaledWrapper =
nullptr;
79 #endif // __WINDOWS_CTRLHANDLER_HPP__
BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
Definition: windows_ctrlhandler.hpp:31
std::function< void(int, int)> * signaledWrapper
Definition: posix_signalhandler.hpp:29
Definition: posix_signalhandler.hpp:23
#define SIGUSR1
Definition: windows_ctrlhandler.hpp:24
int installCtrlHandler(const std::function< void(int, int)> *signal)
Definition: windows_ctrlhandler.hpp:52
Definition: attributes.hpp:24