I am developing an application handling CTRL-C. I am producing a signal handler to shut-down gracefully threads and other resources.
I want to
Introduce a level of indirection.
Program
).shutdown()
method, which performs all of the shutdown operation except calling std::exit()
.shutdown()
method as you would any other method.shutdown()
method for the static
Program
object that represents your entire program then call std::exit()
. This is the only part you can not unit test.