summaryrefslogtreecommitdiff
path: root/pthread_mutex_trylock.c
diff options
context:
space:
mode:
Diffstat (limited to 'pthread_mutex_trylock.c')
-rw-r--r--pthread_mutex_trylock.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/pthread_mutex_trylock.c b/pthread_mutex_trylock.c
index 66eb96e..97f33cd 100644
--- a/pthread_mutex_trylock.c
+++ b/pthread_mutex_trylock.c
@@ -76,22 +76,15 @@ pthread_mutex_trylock(pthread_mutex_t *mutex)
}
else
{
- if( mx->kind != PTHREAD_MUTEX_FAST_NP &&
- pthread_equal( mx->ownerThread, pthread_self() ) )
- {
- if( mx->kind == PTHREAD_MUTEX_RECURSIVE_NP )
- {
- mx->recursive_count++;
- }
- else
- {
- result = EDEADLK;
- }
- }
- else
- {
- result = EBUSY;
- }
+ if( mx->kind == PTHREAD_MUTEX_RECURSIVE_NP &&
+ pthread_equal( mx->ownerThread, pthread_self() ) )
+ {
+ mx->recursive_count++;
+ }
+ else
+ {
+ result = EBUSY;
+ }
}
}