summaryrefslogtreecommitdiff
path: root/pthread_mutex_trylock.c
diff options
context:
space:
mode:
authorrpj <rpj>2011-07-01 00:51:56 +0000
committerrpj <rpj>2011-07-01 00:51:56 +0000
commit1e0bb8a09c86d144f3779bc4d5724afe3f637922 (patch)
treeb4c0c0a6221360107d2bf816523594352eac5f34 /pthread_mutex_trylock.c
parent5af9e85e56dbcae60f771619131ecbc17980fdaa (diff)
Redo Interlocked macros; see the ChangeLog
Diffstat (limited to 'pthread_mutex_trylock.c')
-rw-r--r--pthread_mutex_trylock.c18
1 files changed, 9 insertions, 9 deletions
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)
{