diff options
author | rpj <rpj> | 2011-06-29 05:10:00 +0000 |
---|---|---|
committer | rpj <rpj> | 2011-06-29 05:10:00 +0000 |
commit | 3f334b78ab4447a37ed40b34c5fdd1aac76d3df7 (patch) | |
tree | 18dee585760e0b4d84efe15647bb5b630621cc7f /pthread_mutex_unlock.c | |
parent | 26ed1ebeb95caec8d733a6a91e71e31312a8eb06 (diff) |
PTW32_INTERLOCKED_* fixups
Diffstat (limited to 'pthread_mutex_unlock.c')
-rw-r--r-- | pthread_mutex_unlock.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/pthread_mutex_unlock.c b/pthread_mutex_unlock.c index 5cd51af..59604fd 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) PTW32_INTERLOCKED_EXCHANGE ((LPLONG) &mx->lock_idx, - (LONG) 0); + idx = (LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE ((PTW32_INTERLOCKED_PTR)&mx->lock_idx, + (PTW32_INTERLOCKED_VALUE)0); if (idx != 0) { if (idx < 0) @@ -91,8 +91,8 @@ pthread_mutex_unlock (pthread_mutex_t * mutex) { mx->ownerThread.p = NULL; - if ((LONG) PTW32_INTERLOCKED_EXCHANGE ((LPLONG) &mx->lock_idx, - (LONG) 0) < 0) + if ((LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE ((PTW32_INTERLOCKED_PTR)&mx->lock_idx, + (PTW32_INTERLOCKED_VALUE)0) < 0) { /* 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((LPLONG) &mx->robustNode->stateInconsistent, - (LONG)PTW32_ROBUST_NOTRECOVERABLE, - (LONG)PTW32_ROBUST_INCONSISTENT); + PTW32_INTERLOCKED_COMPARE_EXCHANGE((PTW32_INTERLOCKED_PTR) &mx->robustNode->stateInconsistent, + (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_NOTRECOVERABLE, + (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_INCONSISTENT); if (PTHREAD_MUTEX_NORMAL == kind) { ptw32_robust_mutex_remove(mutex, NULL); - if ((LONG) PTW32_INTERLOCKED_EXCHANGE((LPLONG) &mx->lock_idx, - (LONG) 0) < 0) + if ((LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE((PTW32_INTERLOCKED_PTR) &mx->lock_idx, + (PTW32_INTERLOCKED_VALUE) 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) PTW32_INTERLOCKED_EXCHANGE((LPLONG) &mx->lock_idx, - (LONG) 0) < 0) + if ((LONG)(size_t) PTW32_INTERLOCKED_EXCHANGE((PTW32_INTERLOCKED_PTR) &mx->lock_idx, + (PTW32_INTERLOCKED_VALUE) 0) < 0) { /* * Someone may be waiting on that mutex. |