Sort:  

boost::asio::signal_set automatically handles all of this. I added a section on this.