diff options
author | rpj <rpj> | 2005-01-01 14:25:02 +0000 |
---|---|---|
committer | rpj <rpj> | 2005-01-01 14:25:02 +0000 |
commit | c047ca63139fd3b9e0dedc224dffe04666204dd1 (patch) | |
tree | 75ce525b318a53e25a95a44d6db9f77b53efdabb /pthread_mutex_lock.c | |
parent | b784d0336a41cab82fd3099b865a7d8e07cf1a23 (diff) |
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; + } } } } |