ThreadPool patter implementation in C++