From e1d015c3dc92a70d787a5686bc7518c6f42fe81f Mon Sep 17 00:00:00 2001 From: rpj Date: Tue, 25 Jan 2005 05:37:42 +0000 Subject: Recursive mutex bug fix --- pthread_mutex_lock.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pthread_mutex_lock.c') diff --git a/pthread_mutex_lock.c b/pthread_mutex_lock.c index cb429ef..301f7bf 100644 --- a/pthread_mutex_lock.c +++ b/pthread_mutex_lock.c @@ -88,9 +88,10 @@ pthread_mutex_lock (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; -- cgit v1.2.3