diff options
Diffstat (limited to 'pthread_mutex_lock.c')
-rw-r--r-- | pthread_mutex_lock.c | 13 |
1 files changed, 7 insertions, 6 deletions
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; + } } } } |