diff options
Diffstat (limited to 'pthread_mutex_trylock.c')
-rw-r--r-- | pthread_mutex_trylock.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pthread_mutex_trylock.c b/pthread_mutex_trylock.c index e8ea57b..a0f063d 100644 --- a/pthread_mutex_trylock.c +++ b/pthread_mutex_trylock.c @@ -64,11 +64,10 @@ pthread_mutex_trylock (pthread_mutex_t * mutex) mx = *mutex; - if ((PTW32_INTERLOCKED_LONG) -1 == - PTW32_INTERLOCKED_COMPARE_EXCHANGE ((PTW32_INTERLOCKED_LPLONG) & - mx->lock_idx, - (PTW32_INTERLOCKED_LONG) 0, - (PTW32_INTERLOCKED_LONG) -1)) + if (0 == (LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE ( + (PTW32_INTERLOCKED_LPLONG) &mx->lock_idx, + (PTW32_INTERLOCKED_LONG) 1, + (PTW32_INTERLOCKED_LONG) 0)) { if (mx->kind != PTHREAD_MUTEX_NORMAL) { |