Finally got proper termination procedure working.
Use cerr instead of cout for status messages
Add termination procedure to threading-example