improving signal handling of the App class
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user