Use boost::mutex instead of pthread_mutex_lock.