From 2f59893abc1ef66e851c4bba56c4b421710d4183 Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 19 Feb 1999 03:15:05 +0000 Subject: Fri Feb 19 16:2s1703:30 1999 Ross Johnson * sync.c (pthread_join): Fix pthread_equal() test. * mutex.c (pthread_mutex_trylock): Check mutex != NULL before using it. --- mutex.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'mutex.c') diff --git a/mutex.c b/mutex.c index cca8fa3..2b28cec 100644 --- a/mutex.c +++ b/mutex.c @@ -508,17 +508,17 @@ pthread_mutex_trylock(pthread_mutex_t *mutex) { int result = 0; + if (mutex == NULL) + { + return EINVAL; + } + if (mutex->mutex == 0 && _pthread_try_enter_critical_section == NULL) { /* TryEnterCriticalSection does not exist in the OS; return ENOSYS. */ return ENOSYS; } - if (mutex == NULL) - { - return EINVAL; - } - /* * We do a quick check to see if we need to do more work * to initialise a static mutex. We check 'staticinit' -- cgit v1.2.3