improving signal handling of the App class

This commit is contained in:
2018-09-06 09:59:54 +00:00
parent e8804b20ec
commit 5f29d1670f
3 changed files with 111 additions and 38 deletions

View File

@ -93,26 +93,24 @@ static int test1()
QSE::HeapMmgr heap_mmgr (QSE::Mmgr::getDFL(), 30000);
MyApp app (&heap_mmgr);
MyApp app2 (&heap_mmgr);
MyApp app3 (&heap_mmgr);
MyApp app4 (&heap_mmgr);
//MyApp app2 (&heap_mmgr);
//MyApp app3 (&heap_mmgr);
//MyApp app4 (&heap_mmgr);
app.subscribeToSignal (SIGINT, true);
app.subscribeToSignal (SIGTERM, true);
app4.subscribeToSignal (SIGINT, true);
app3.subscribeToSignal (SIGINT, true);
app2.subscribeToSignal (SIGINT, true);
//app4.subscribeToSignal (SIGINT, true);
//app3.subscribeToSignal (SIGINT, true);
//app2.subscribeToSignal (SIGINT, true);
int n = app.run();
app.subscribeToSignal (SIGTERM, false);
app.subscribeToSignal (SIGINT, false);
app4.unsubscribeFromSignal (SIGINT);
app3.unsubscribeFromSignal (SIGINT);
app2.unsubscribeFromSignal (SIGINT);
//app4.unsubscribeFromSignal (SIGINT);
//app3.unsubscribeFromSignal (SIGINT);
//app2.unsubscribeFromSignal (SIGINT);
return n;
}