summaryrefslogtreecommitdiff
path: root/ptw32_MCS_lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'ptw32_MCS_lock.c')
-rw-r--r--ptw32_MCS_lock.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/ptw32_MCS_lock.c b/ptw32_MCS_lock.c
index 3a85c1b..d69cf80 100644
--- a/ptw32_MCS_lock.c
+++ b/ptw32_MCS_lock.c
@@ -165,8 +165,8 @@ ptw32_mcs_lock_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * node)
node->next = 0; /* initially, no successor */
/* queue for the lock */
- pred = (ptw32_mcs_local_node_t *)PTW32_INTERLOCKED_EXCHANGE_PTR((PVOID volatile *)lock,
- (PVOID) node);
+ pred = (ptw32_mcs_local_node_t *)PTW32_INTERLOCKED_EXCHANGE_PTR((PTW32_INTERLOCKED_PVOID_PTR)lock,
+ (PTW32_INTERLOCKED_PVOID)node);
if (0 != pred)
{
@@ -201,9 +201,9 @@ ptw32_mcs_lock_release (ptw32_mcs_local_node_t * node)
/* no known successor */
if (node == (ptw32_mcs_local_node_t *)
- PTW32_INTERLOCKED_COMPARE_EXCHANGE_PTR((PVOID volatile *)lock,
- (PVOID)0,
- (PVOID)node))
+ PTW32_INTERLOCKED_COMPARE_EXCHANGE_PTR((PTW32_INTERLOCKED_PVOID_PTR)lock,
+ (PTW32_INTERLOCKED_PVOID)0,
+ (PTW32_INTERLOCKED_PVOID)node))
{
/* no successor, lock is free now */
return;
@@ -233,10 +233,10 @@ ptw32_mcs_lock_try_acquire (ptw32_mcs_lock_t * lock, ptw32_mcs_local_node_t * no
node->readyFlag = 0;
node->next = 0; /* initially, no successor */
- return ((PVOID)PTW32_INTERLOCKED_COMPARE_EXCHANGE_PTR((PVOID volatile *)lock,
- (PVOID)node,
- (PVOID)0)
- == (PVOID)0) ? 0 : EBUSY;
+ return ((PTW32_INTERLOCKED_PVOID)PTW32_INTERLOCKED_COMPARE_EXCHANGE_PTR((PTW32_INTERLOCKED_PVOID_PTR)lock,
+ (PTW32_INTERLOCKED_PVOID)node,
+ (PTW32_INTERLOCKED_PVOID)0)
+ == (PTW32_INTERLOCKED_PVOID)0) ? 0 : EBUSY;
}
/*
@@ -261,9 +261,9 @@ ptw32_mcs_node_transfer (ptw32_mcs_local_node_t * new_node, ptw32_mcs_local_node
new_node->readyFlag = 0; /* Not needed - we were waiting on this */
new_node->next = 0;
- if ((ptw32_mcs_local_node_t *)PTW32_INTERLOCKED_COMPARE_EXCHANGE_PTR((PVOID volatile *)new_node->lock,
- (PVOID)new_node,
- (PVOID)old_node)
+ if ((ptw32_mcs_local_node_t *)PTW32_INTERLOCKED_COMPARE_EXCHANGE_PTR((PTW32_INTERLOCKED_PVOID_PTR)new_node->lock,
+ (PTW32_INTERLOCKED_PVOID)new_node,
+ (PTW32_INTERLOCKED_PVOID)old_node)
!= old_node)
{
/*