diff options
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | implement.h | 2 | ||||
| -rw-r--r-- | pthread_barrier_wait.c | 10 | ||||
| -rw-r--r-- | ptw32_MCS_lock.c | 4 | 
4 files changed, 10 insertions, 8 deletions
| @@ -10,6 +10,8 @@  	* ptw32_MCS_lock.c: Converted interlocked calls to use new macros.
  	* pthread_barrier_wait.c: Likewise.
  	* pthread_once.c: Likewise.
 +	* ptw32_MCS_lock.c (ptw32_mcs_node_substitute): Name changed to
 +	ptw32_mcs_node_transfer.
  2011-02-28  Ross Johnson <ross.johnson at homemail.com.au>
 diff --git a/implement.h b/implement.h index 1bd3ce9..9e449cb 100644 --- a/implement.h +++ b/implement.h @@ -624,7 +624,7 @@ extern "C"    void ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node); -  void ptw32_mcs_node_substitute (ptw32_mcs_local_node_t * new_node, ptw32_mcs_local_node_t * old_node); +  void ptw32_mcs_node_transfer (ptw32_mcs_local_node_t * new_node, ptw32_mcs_local_node_t * old_node);  #ifdef NEED_FTIME    void ptw32_timespec_to_filetime (const struct timespec *ts, FILETIME * ft); diff --git a/pthread_barrier_wait.c b/pthread_barrier_wait.c index d60ba60..b0b4481 100644 --- a/pthread_barrier_wait.c +++ b/pthread_barrier_wait.c @@ -61,7 +61,7 @@ pthread_barrier_wait (pthread_barrier_t * barrier)         * Move our MCS local node to the global scope barrier handle so that the         * last thread out (not necessarily us) can release the lock.         */ -      ptw32_mcs_node_substitute(&b->proxynode, &node); +      ptw32_mcs_node_transfer(&b->proxynode, &node);        /*         * Any threads that have not quite entered sem_wait below when the @@ -90,12 +90,12 @@ pthread_barrier_wait (pthread_barrier_t * barrier)    if ((PTW32_INTERLOCKED_LONG)PTW32_INTERLOCKED_INCREMENT((LPLONG)&b->nCurrentBarrierHeight)  		  == (PTW32_INTERLOCKED_LONG)b->nInitialBarrierHeight)      { -  /* +      /*         * We are the last thread to cross this barrier -   */ +       */        ptw32_mcs_lock_release(&b->proxynode); -  if (0 == result) -    { +      if (0 == result) +        {            result = PTHREAD_BARRIER_SERIAL_THREAD;          }      } diff --git a/ptw32_MCS_lock.c b/ptw32_MCS_lock.c index 1cdf723..55e4565 100644 --- a/ptw32_MCS_lock.c +++ b/ptw32_MCS_lock.c @@ -236,7 +236,7 @@ ptw32_mcs_lock_try_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * no  }  /* - * ptw32_mcs_node_substitute -- move an MCS lock local node, usually from thread + * ptw32_mcs_node_transfer -- move an MCS lock local node, usually from thread   * space to, for example, global space so that another thread can release   * the lock on behalf of the current lock owner.   * @@ -247,7 +247,7 @@ ptw32_mcs_lock_try_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * no   * Should only be called by the thread that has the lock.   */  INLINE void -ptw32_mcs_node_substitute (ptw32_mcs_local_node_t * new_node, ptw32_mcs_local_node_t * old_node) +ptw32_mcs_node_transfer (ptw32_mcs_local_node_t * new_node, ptw32_mcs_local_node_t * old_node)  {    new_node->lock = old_node->lock;    new_node->nextFlag = 0; /* Not needed - used only in initial Acquire */ | 
