summaryrefslogtreecommitdiff
path: root/pthread_mutex_consistent.c
diff options
context:
space:
mode:
authorrpj <rpj>2011-06-29 05:10:00 +0000
committerrpj <rpj>2011-06-29 05:10:00 +0000
commit3f334b78ab4447a37ed40b34c5fdd1aac76d3df7 (patch)
tree18dee585760e0b4d84efe15647bb5b630621cc7f /pthread_mutex_consistent.c
parent26ed1ebeb95caec8d733a6a91e71e31312a8eb06 (diff)
PTW32_INTERLOCKED_* fixups
Diffstat (limited to 'pthread_mutex_consistent.c')
-rwxr-xr-xpthread_mutex_consistent.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/pthread_mutex_consistent.c b/pthread_mutex_consistent.c
index 681358c..0f63d1b 100755
--- a/pthread_mutex_consistent.c
+++ b/pthread_mutex_consistent.c
@@ -80,10 +80,10 @@ ptw32_robust_mutex_inherit(pthread_mutex_t * mutex)
pthread_mutex_t mx = *mutex;
ptw32_robust_node_t* robust = mx->robustNode;
- switch (PTW32_INTERLOCKED_COMPARE_EXCHANGE(
- (LPLONG)&robust->stateInconsistent,
- (LONG)PTW32_ROBUST_INCONSISTENT,
- -1L /* The terminating thread sets this */))
+ switch ((LONG)(size_t)PTW32_INTERLOCKED_COMPARE_EXCHANGE(
+ (PTW32_INTERLOCKED_PTR)&robust->stateInconsistent,
+ (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_INCONSISTENT,
+ (PTW32_INTERLOCKED_VALUE)-1 /* The terminating thread sets this */))
{
case -1L:
result = EOWNERDEAD;
@@ -177,10 +177,10 @@ pthread_mutex_consistent (pthread_mutex_t* mutex)
}
if (mx->kind >= 0
- || (LONG)PTW32_ROBUST_INCONSISTENT != PTW32_INTERLOCKED_COMPARE_EXCHANGE(
- (LPLONG)&mx->robustNode->stateInconsistent,
- (LONG)PTW32_ROBUST_CONSISTENT,
- (LONG)PTW32_ROBUST_INCONSISTENT))
+ || (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_INCONSISTENT != PTW32_INTERLOCKED_COMPARE_EXCHANGE(
+ (PTW32_INTERLOCKED_PTR)&mx->robustNode->stateInconsistent,
+ (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_CONSISTENT,
+ (PTW32_INTERLOCKED_VALUE)PTW32_ROBUST_INCONSISTENT))
{
result = EINVAL;
}