MIgrate to boost::threads, boost:mutexes and boost::chrono because threading capabilities is is buggy in C++11 with gcc 4.7