Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
tAquireSignalProcessor
#include <stdio.h> #include <stdlib.h> #include <signal.h> #include <file> class tAquireSignalProcessor { public: tAquireSignalProcessor(const int signalID) { signal(signalID, sigHandler); } bool doProcess() { if(m_receivedSignal) { //reset m_receivedSignal = false; return true; } process(); return false; } private: static void sigHandler(int signum) { printf("Received signal %d\n", signum); m_receivedSignal = true; }; void process() { }; static bool m_receivedSignal; }; bool tAquireSignalProcessor::m_receivedSignal = false; int main() { tAquireSignalProcessor mysigprocessor(SIGUSR1); while(mysigprocessor.doProcess() == false) { } return 0; }
run
|
edit
|
history
|
help
0
XML parsing with regex
Certificate Printing
mergesort tree
lab17feb22x4B.cpp
BinTreeInsert
Graph Theory
Empty C++ Script
sort
Shortest Non Common Subsequence
check Prime