From 45b1b8cb2a6588f9316f780d8cefe11c181a9a17 Mon Sep 17 00:00:00 2001 From: rpj Date: Sat, 16 Oct 2004 02:34:44 +0000 Subject: Mutex speedups cont'd --- pthread_mutex_trylock.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'pthread_mutex_trylock.c') 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) { -- cgit v1.2.3