Exemple #1
0
extern "C" void pthread_exit(void *value_ptr)
{
  WRAPPER_HEADER_NO_RETURN(pthread_exit, _real_pthread_exit, value_ptr);

  if (SYNC_IS_REPLAY) {
    waitForTurn(&my_entry, &pthread_exit_turn_check);
    getNextLogEntry();
    _real_pthread_exit(value_ptr);
  } else  if (SYNC_IS_RECORD) {
    // Not restart; we should be logging.
    addNextLogEntry(my_entry);
    _real_pthread_exit(value_ptr);
  }
  while(1); // to suppress compiler warning about 'noreturn' function returning
}
extern "C" void pthread_exit(void * retval)
{
  WRAPPER_EXECUTION_DISABLE_CKPT();
  mtcpFuncPtrs.threadiszombie();
  dmtcp::ProcessInfo::instance().eraseTid(gettid());
  dmtcp_process_event(DMTCP_EVENT_PTHREAD_EXIT, NULL);
  WRAPPER_EXECUTION_ENABLE_CKPT();
  dmtcp::ThreadSync::unsetOkToGrabLock();
  _real_pthread_exit(retval);
  for(;;); // To hide compiler warning about "noreturn" function
}