Changed from c++11 threads to pthreads...