pthread_exit(PTHREAD_CANCELED);
__pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME);
pthread_cond_timedwait_relative(pthread_cond_t *cond,				pthread_mutex_t *mutex,				const struct timespec * abstime){  volatile pthread_descr self = thread_self();  int already_canceled = 0;  pthread_extricate_if extr;  int spurious_wakeup_count;  /* Check whether the mutex is locked and owned by this thread.  */  if (mutex->__m_kind != PTHREAD_MUTEX_TIMED_NP      && mutex->__m_kind != PTHREAD_MUTEX_ADAPTIVE_NP      && mutex->__m_owner != self)    return EINVAL;  /* Set up extrication interface */  extr.pu_object = cond;  extr.pu_extricate_func = cond_extricate_func;  /* Register extrication interface */  THREAD_SETMEM(self, p_condvar_avail, 0);  __pthread_set_own_extricate_if(self, &extr);  /* Enqueue to wait on the condition and check for cancellation. */  __pthread_lock(&cond->__c_lock, self);  if (!(THREAD_GETMEM(self, p_canceled)      && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE))    enqueue(&cond->__c_waiting, self);  else    already_canceled = 1;  __pthread_unlock(&cond->__c_lock);  if (already_canceled) {    __pthread_set_own_extricate_if(self, 0);    pthread_exit(PTHREAD_CANCELED);  }  pthread_mutex_unlock(mutex);  spurious_wakeup_count = 0;  while (1)    {      if (!timedsuspend(self, abstime)) {	int was_on_queue;	/* __pthread_lock will queue back any spurious restarts that	   may happen to it. */	__pthread_lock(&cond->__c_lock, self);	was_on_queue = remove_from_queue(&cond->__c_waiting, self);	__pthread_unlock(&cond->__c_lock);	if (was_on_queue) {	  __pthread_set_own_extricate_if(self, 0);	  pthread_mutex_lock(mutex);	  return ETIMEDOUT;	}	/* Eat the outstanding restart() from the signaller */	suspend(self);      }      if (THREAD_GETMEM(self, p_condvar_avail) == 0	  && (THREAD_GETMEM(self, p_woken_by_cancel) == 0	      || THREAD_GETMEM(self, p_cancelstate) != PTHREAD_CANCEL_ENABLE))	{	  /* Count resumes that don't belong to us. */	  spurious_wakeup_count++;	  continue;	}      break;    }  __pthread_set_own_extricate_if(self, 0);  /* The remaining logic is the same as in other cancellable waits,     such as pthread_join sem_wait or pthread_cond wait. */  if (THREAD_GETMEM(self, p_woken_by_cancel)      && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) {    THREAD_SETMEM(self, p_woken_by_cancel, 0);    pthread_mutex_lock(mutex);    pthread_exit(PTHREAD_CANCELED);  }  /* Put back any resumes we caught that don't belong to us. */  while (spurious_wakeup_count--)    restart(self);  pthread_mutex_lock(mutex);  return 0;}