Bug #2008

Clean up and exit properly when receiving SIG{INT,TERM}

Added by J. Moringen over 9 years ago. Updated over 9 years ago.

Status:ResolvedStart date:09/17/2014
Priority:NormalDue 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

Blocked by Robotics Systems Commons - Feature #2007: Provide a mechanism for waiting until a termination reque... Resolved 09/16/2014

Associated revisions

Revision 0350b1bb
Added by J. Moringen over 9 years ago

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

Revision 366d8d95
Added by J. Moringen over 9 years ago

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

Also available in: Atom PDF