From c047ca63139fd3b9e0dedc224dffe04666204dd1 Mon Sep 17 00:00:00 2001 From: rpj Date: Sat, 1 Jan 2005 14:25:02 +0000 Subject: '' --- pthread_mutex_lock.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'pthread_mutex_lock.c') diff --git a/pthread_mutex_lock.c b/pthread_mutex_lock.c index 870208b..ce5e5f6 100644 --- a/pthread_mutex_lock.c +++ b/pthread_mutex_lock.c @@ -114,17 +114,18 @@ pthread_mutex_lock (pthread_mutex_t * mutex) (LPLONG) &mx->lock_idx, (LONG) -1) != 0) { - if (WAIT_OBJECT_0 == WaitForSingleObject (mx->event, INFINITE)) - { - mx->recursive_count = 1; - mx->ownerThread = self; - } - else + if (WAIT_OBJECT_0 != WaitForSingleObject (mx->event, INFINITE)) { result = EINVAL; break; } } + + if (0 == result) + { + mx->recursive_count = 1; + mx->ownerThread = self; + } } } } -- cgit v1.2.3