Bug #2008
Clean up and exit properly when receiving SIG{INT,TERM}
Status: | Resolved | Start date: | 09/17/2014 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | J. Moringen | % Done: | 100% | |
Category: | C++ Tools | |||
Target version: | rsb-0.11 |
Description
Affected tools
- logger-cpp
- timesync-cpp
- buffer-cpp
Related issues
Associated revisions
Use termination signal waiting in tool main functions
fixes #2008
- src/logger/rsb/tools/logger/main.cpp: updated copyright
(include signal.h): removed; no longer needed
(include rsc/misc/SignalWaiter.h): new include; replacement
(doTerminate): removed; no longer needed
(terminateMutex): likewise
(terminateCondition): likewise
(handleSIGINT): likewise
(main): call initSignalWaiter and waitForSignal instead of setting up
a signal handler to notify the condition variable - src/timesync/rsb/tools/timesync/rsbtimesync.cpp (include signal.h):
removed; no longer needed
(include unistd.h): likewise
(include rsc/misc/SignalWaiter.h): new include; replacement
(doTerminate): removed; no longer needed
(onStopSignal): likewise
(main): call initSignalWaiter and waitForSignal instead of setting up
a signal handlers to toggle doTerminate - src/simplebuffer/rsb/tools/simplebuffer/simple_runner.cpp
(include rsc/misc/SignalWaiter.h): new include
(main): call initSignalWaiter and waitForSignal instead of waiting
forever
Use rsc::misc::{waitForSignal,hasSignalArrived} in examples/**/*.cpp
refs #2008
- examples/buffer/delayed_requester.cpp (main): use
rsc::mmisc::waitForSignal - examples/timesync/rsbts_display.cpp (main): use
rsc::misc::hasSignalArrived
History
#1 Updated by J. Moringen over 9 years ago
- Blocked by Feature #2007: Provide a mechanism for waiting until a termination request (e.g. SIGINT) arrives added
#2 Updated by J. Moringen over 9 years ago
- % Done changed from 0 to 70
#3 Updated by J. Moringen over 9 years ago
- Status changed from In Progress to Resolved
- % Done changed from 70 to 100
Applied in changeset rsb-tools-cpp|0350b1bb187aff176e788078f4b13ddb0fbd27bc.