VOID pinFini( INT32 code, VOID *v ) { VERBOSE(stderr, "pinFini: %d\n", code); // wait for the IO thread to terminate /*bool done =*/ PIN_WaitForThreadTermination( s_IOThreadId, PIN_INFINITE_TIMEOUT, NULL ); //assert( done ); // get a core dump if the IO thread times out cerr << "[rcdcsim] front end pintool finished" << endl; }
bool Thread::wait (UINT32 millis, INT32 * exit_code) { // Ideally, we would like to put a read guard here while we are "reading" // the thread uid. Unfortunately, using a read guard here results in the // program hanging if the wait() method is called in fini unlocked by a // tool (the most logical place to call this method). Read_Guard <RW_Mutex> guard (this->rw_mutex_); if (this->thr_uid_ == INVALID_PIN_THREAD_UID) return true; return PIN_WaitForThreadTermination (this->thr_uid_, millis, exit_code); }