Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 May 2017 17:10:56 +0000 (UTC)
From:      Jason Evans <jasone@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r318277 - stable/11/lib/libthr/thread
Message-ID:  <201705141710.v4EHAuGg032848@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jasone
Date: Sun May 14 17:10:55 2017
New Revision: 318277
URL: https://svnweb.freebsd.org/changeset/base/318277

Log:
  MFC r318254:
  
  Fix __pthread_mutex_trylock() to call THR_CRITICAL_LEAVE() on failure rather
  than on success.  This regression was introduced by r300043 (Add implementation
  of robust mutexes...).

Modified:
  stable/11/lib/libthr/thread/thr_mutex.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libthr/thread/thr_mutex.c
==============================================================================
--- stable/11/lib/libthr/thread/thr_mutex.c	Sun May 14 14:27:59 2017	(r318276)
+++ stable/11/lib/libthr/thread/thr_mutex.c	Sun May 14 17:10:55 2017	(r318277)
@@ -631,7 +631,7 @@ __pthread_mutex_trylock(pthread_mutex_t 
 	} /* else {} */
 	if (robust)
 		_mutex_leave_robust(curthread, m);
-	if ((ret == 0 || ret == EOWNERDEAD) &&
+	if (ret != 0 && ret != EOWNERDEAD &&
 	    (m->m_flags & PMUTEX_FLAG_PRIVATE) != 0)
 		THR_CRITICAL_LEAVE(curthread);
 	return (ret);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705141710.v4EHAuGg032848>