From: Andreas Jaeger Date: Mon, 31 Jul 2000 15:31:21 +0000 (+0000) Subject: * mutex.c (__pthread_mutex_trylock): Only set mutex owner if we X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91856709da3e84e2d2b3addcb24815ba88f11cd7;p=thirdparty%2Fglibc.git * mutex.c (__pthread_mutex_trylock): Only set mutex owner if we really own it. Patch by Kevin B. Hendricks" . --- diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index b4bebf975b9..2f2ab954d04 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,9 @@ +2000-07-31 Andreas Jaeger + + * mutex.c (__pthread_mutex_trylock): Only set mutex owner if we + really own it. + Patch by Kevin B. Hendricks" . + 2000-04-09 Ulrich Drepper * signals.c (sigaction): Fix return value for the case SIG is one diff --git a/linuxthreads/mutex.c b/linuxthreads/mutex.c index 5f0b81b7025..ed1e7607c18 100644 --- a/linuxthreads/mutex.c +++ b/linuxthreads/mutex.c @@ -50,7 +50,8 @@ int __pthread_mutex_trylock(pthread_mutex_t * mutex) switch(mutex->__m_kind) { case PTHREAD_MUTEX_FAST_NP: retcode = __pthread_trylock(&mutex->__m_lock); - mutex->__m_owner = thread_self(); + if (retcode == 0) + mutex->__m_owner = thread_self(); return retcode; case PTHREAD_MUTEX_RECURSIVE_NP: self = thread_self();