__pthread_unlock((struct _pthread_fastlock *) &sem->sem_lock);
__pthread_unlock((struct _pthread_fastlock *) &sem->__sem_lock);
int sem_wait(sem_t * sem){  volatile pthread_descr self = thread_self();  __pthread_lock((struct _pthread_fastlock *) &sem->sem_lock, self);  if (sem->sem_value > 0) {    sem->sem_value--;    __pthread_unlock((struct _pthread_fastlock *) &sem->sem_lock);    return 0;  }  enqueue(&sem->sem_waiting, self);  /* Wait for sem_post or cancellation */  __pthread_unlock((struct _pthread_fastlock *) &sem->sem_lock);  suspend_with_cancellation(self);  /* This is a cancellation point */  if (THREAD_GETMEM(self, p_canceled)      && THREAD_GETMEM(self, p_cancelstate) == PTHREAD_CANCEL_ENABLE) {    /* Remove ourselves from the waiting list if we're still on it */    __pthread_lock((struct _pthread_fastlock *) &sem->sem_lock, self);    remove_from_queue(&sem->sem_waiting, self);    __pthread_unlock((struct _pthread_fastlock *) &sem->sem_lock);    pthread_exit(PTHREAD_CANCELED);  }  /* We got the semaphore */  return 0;}