Own implementation of ThreadPool in C++