acquire(th->p_spinlock);
__pthread_lock(th->p_lock);
static void pthread_handle_free(pthread_descr th){  pthread_descr t;  /* Check that the thread th is still there -- pthread_reap_children     might have deallocated it already */  t = __pthread_main_thread;  do {    if (t == th) break;    t = t->p_nextlive;  } while (t != __pthread_main_thread);  if (t != th) return;  acquire(th->p_spinlock);  if (th->p_exited) {    release(th->p_spinlock);    pthread_free(th);  } else {    /* The Unix process of the thread is still running.       Mark the thread as detached so that the thread manager will       deallocate its resources when the Unix process exits. */    th->p_detached = 1;    release(th->p_spinlock);  }}