void* MyThread::the_thread(void * param) { MyThread *thread; void *ret; thread = (MyThread*)param; thread->continue_mtx2_.lock(); thread->mutex_.lock(); thread->running_ = true; thread->mutex_.unlock(); thread->continue_mtx_.lock(); thread->continue_mtx_.unlock(); ret = thread->thread(); thread->mutex_.lock(); thread->running_ = false; thread->retval_ = ret; thread->mutex_.unlock(); return NULL; }