replaced tinythread with C++11 <thread>