wait_node.thr = self = thread_self();
wait_node.thr = self;
void __pthread_alt_lock(struct _pthread_fastlock * lock,		        pthread_descr self){#if defined HAS_COMPARE_AND_SWAP  long oldstatus, newstatus;#endif  struct wait_node wait_node;#if defined TEST_FOR_COMPARE_AND_SWAP  if (!__pthread_has_cas)#endif#if !defined HAS_COMPARE_AND_SWAP || defined TEST_FOR_COMPARE_AND_SWAP  {    int suspend_needed = 0;    __pthread_acquire(&lock->__spinlock);    if (lock->__status == 0)      lock->__status = 1;    else {      if (self == NULL)	self = thread_self();      wait_node.abandoned = 0;      wait_node.next = (struct wait_node *) lock->__status;      wait_node.thr = self = thread_self();      suspend_needed = 1;    }    WRITE_MEMORY_BARRIER();    lock->__spinlock = 0;    if (suspend_needed)      suspend (self);    return;  }#endif#if defined HAS_COMPARE_AND_SWAP  do {    oldstatus = lock->__status;    if (oldstatus == 0) {      newstatus = 1;    } else {      if (self == NULL)	wait_node.thr = self = thread_self();      newstatus = (long) &wait_node;    }    wait_node.abandoned = 0;    wait_node.next = (struct wait_node *) oldstatus;    /* Make sure the store in wait_node.next completes before performing       the compare-and-swap */    MEMORY_BARRIER();  } while(! compare_and_swap(&lock->__status, oldstatus, newstatus,                             &lock->__spinlock));  /* Suspend. Note that unlike in __pthread_lock, we don't worry     here about spurious wakeup. That's because this lock is not     used in situations where that can happen; the restart can     only come from the previous lock owner. */  if (oldstatus != 0)    suspend(self);#endif}