summaryrefslogtreecommitdiff
path: root/pthread_mutex_unlock.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_unlock.c
parent5af9e85e56dbcae60f771619131ecbc17980fdaa (diff)
Redo Interlocked macros; see the ChangeLog
Diffstat (limited to 'pthread_mutex_unlock.c')
-rw-r--r--pthread_mutex_unlock.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/pthread_mutex_unlock.c b/pthread_mutex_unlock.c
index 59604fd..51e2b78 100644
--- a/pthread_mutex_unlock.c
+++ b/pthread_mutex_unlock.c
@@ -66,8 +66,8 @@ pthread_mutex_unlock (pthread_mutex_t * mutex)
{
LONG idx;
- idx = (LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE ((PTW32_INTERLOCKED_PTR)&mx->lock_idx,
- (PTW32_INTERLOCKED_VALUE)0);
+ idx = (LONG) PTW32_INTERLOCKED_EXCHANGE_LONG ((PTW32_INTERLOCKED_PTR)&mx->lock_idx,
+ (PTW32_INTERLOCKED_LONG)0);
if (idx != 0)
{
if (idx < 0)
@@ -91,8 +91,8 @@ pthread_mutex_unlock (pthread_mutex_t * mutex)
{
mx->ownerThread.p = NULL;
- if ((LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE ((PTW32_INTERLOCKED_PTR)&mx->lock_idx,
- (PTW32_INTERLOCKED_VALUE)0) < 0)
+ if ((LONG) PTW32_INTERLOCKED_EXCHANGE_LONG ((PTW32_INTERLOCKED_PTR)&mx->lock_idx,
+ (PTW32_INTERLOCKED_LONG)0) < 0L)
{
/* Someone may be waiting on that mutex */
if (SetEvent (mx->event) == 0)
@@ -120,15 +120,15 @@ pthread_mutex_unlock (pthread_mutex_t * mutex)
*/
if (pthread_equal (mx->ownerThread, self))
{
- PTW32_INTERLOCKED_COMPARE_EXCHANGE((PTW32_INTERLOCKED_PTR) &mx->robustNode->stateInconsistent,
- (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_NOTRECOVERABLE,
- (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_INCONSISTENT);
+ PTW32_INTERLOCKED_COMPARE_EXCHANGE_LONG((PTW32_INTERLOCKED_PTR) &mx->robustNode->stateInconsistent,
+ (PTW32_INTERLOCKED_LONG)PTW32_ROBUST_NOTRECOVERABLE,
+ (PTW32_INTERLOCKED_LONG)PTW32_ROBUST_INCONSISTENT);
if (PTHREAD_MUTEX_NORMAL == kind)
{
ptw32_robust_mutex_remove(mutex, NULL);
- if ((LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE((PTW32_INTERLOCKED_PTR) &mx->lock_idx,
- (PTW32_INTERLOCKED_VALUE) 0) < 0)
+ if ((LONG) PTW32_INTERLOCKED_EXCHANGE_LONG((PTW32_INTERLOCKED_PTR) &mx->lock_idx,
+ (PTW32_INTERLOCKED_LONG) 0) < 0)
{
/*
* Someone may be waiting on that mutex.
@@ -146,8 +146,8 @@ pthread_mutex_unlock (pthread_mutex_t * mutex)
{
ptw32_robust_mutex_remove(mutex, NULL);
- if ((LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE((PTW32_INTERLOCKED_PTR) &mx->lock_idx,
- (PTW32_INTERLOCKED_VALUE) 0) < 0)
+ if ((LONG) PTW32_INTERLOCKED_EXCHANGE_LONG((PTW32_INTERLOCKED_PTR) &mx->lock_idx,
+ (PTW32_INTERLOCKED_LONG) 0) < 0)
{
/*
* Someone may be waiting on that mutex.