Using C++11 threads to control the server service