From 1e0bb8a09c86d144f3779bc4d5724afe3f637922 Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 1 Jul 2011 00:51:56 +0000 Subject: Redo Interlocked macros; see the ChangeLog --- pthread_mutex_trylock.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'pthread_mutex_trylock.c') diff --git a/pthread_mutex_trylock.c b/pthread_mutex_trylock.c index a57986c..aeb79cd 100644 --- a/pthread_mutex_trylock.c +++ b/pthread_mutex_trylock.c @@ -69,10 +69,10 @@ pthread_mutex_trylock (pthread_mutex_t * mutex) if (kind >= 0) { /* Non-robust */ - if (0 == (PTW32_INTERLOCKED_VALUE) PTW32_INTERLOCKED_COMPARE_EXCHANGE ( + if (0 == (PTW32_INTERLOCKED_LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG ( (PTW32_INTERLOCKED_PTR) &mx->lock_idx, - (PTW32_INTERLOCKED_VALUE) 1, - (PTW32_INTERLOCKED_VALUE) 0)) + (PTW32_INTERLOCKED_LONG) 1, + (PTW32_INTERLOCKED_LONG) 0)) { if (kind != PTHREAD_MUTEX_NORMAL) { @@ -103,10 +103,10 @@ pthread_mutex_trylock (pthread_mutex_t * mutex) pthread_t self; ptw32_robust_state_t* statePtr = &mx->robustNode->stateInconsistent; - if ((PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_NOTRECOVERABLE == - PTW32_INTERLOCKED_EXCHANGE_ADD( + if ((PTW32_INTERLOCKED_LONG)PTW32_ROBUST_NOTRECOVERABLE == + PTW32_INTERLOCKED_EXCHANGE_ADD_LONG( (PTW32_INTERLOCKED_PTR)statePtr, - (PTW32_INTERLOCKED_VALUE)0)) + (PTW32_INTERLOCKED_LONG)0)) { return ENOTRECOVERABLE; } @@ -114,10 +114,10 @@ pthread_mutex_trylock (pthread_mutex_t * mutex) self = pthread_self(); kind = -kind - 1; /* Convert to non-robust range */ - if (0 == (PTW32_INTERLOCKED_VALUE) PTW32_INTERLOCKED_COMPARE_EXCHANGE ( + if (0 == (PTW32_INTERLOCKED_LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG ( (PTW32_INTERLOCKED_PTR) &mx->lock_idx, - (PTW32_INTERLOCKED_VALUE) 1, - (PTW32_INTERLOCKED_VALUE) 0)) + (PTW32_INTERLOCKED_LONG) 1, + (PTW32_INTERLOCKED_LONG) 0)) { if (kind != PTHREAD_MUTEX_NORMAL) { -- cgit v1.2.3