diff options
Diffstat (limited to 'pthread_mutex_timedlock.c')
-rw-r--r-- | pthread_mutex_timedlock.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pthread_mutex_timedlock.c b/pthread_mutex_timedlock.c index b1b9d15..db45f45 100644 --- a/pthread_mutex_timedlock.c +++ b/pthread_mutex_timedlock.c @@ -222,9 +222,10 @@ pthread_mutex_timedlock (pthread_mutex_t * mutex, { pthread_t self = pthread_self(); - if ((LONG) PTW32_INTERLOCKED_EXCHANGE( - (LPLONG) &mx->lock_idx, - (LONG) 1) == 0) + if ((PTW32_INTERLOCKED_LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE( + (PTW32_INTERLOCKED_LPLONG) &mx->lock_idx, + (PTW32_INTERLOCKED_LONG) 1, + (PTW32_INTERLOCKED_LONG) 0) == 0) { mx->recursive_count = 1; mx->ownerThread = self; |