socsvn commit: r238800 - in soc2012/gmiller/locking-head: . lib/libwitness

gmiller at FreeBSD.org gmiller at FreeBSD.org
Mon Jul 2 13:09:31 UTC 2012


Author: gmiller
Date: Mon Jul  2 13:09:28 2012
New Revision: 238800
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=238800

Log:
   r238613 at FreeBSD-dev:  root | 2012-06-29 14:39:44 -0500
   Properly check return values for pthread_mutex_lock() and
   pthread_mutex_unlock().

Modified:
  soc2012/gmiller/locking-head/   (props changed)
  soc2012/gmiller/locking-head/lib/libwitness/wrappers.c

Modified: soc2012/gmiller/locking-head/lib/libwitness/wrappers.c
==============================================================================
--- soc2012/gmiller/locking-head/lib/libwitness/wrappers.c	Mon Jul  2 12:12:16 2012	(r238799)
+++ soc2012/gmiller/locking-head/lib/libwitness/wrappers.c	Mon Jul  2 13:09:28 2012	(r238800)
@@ -38,7 +38,7 @@
 	int ret;
 
 	ret = _pthread_mutex_lock(mutex);
-	if (mutex != &witness_mtx) {
+	if (mutex != &witness_mtx && ret == 0) {
 		add_lock(mutex);
 	}
 
@@ -51,7 +51,7 @@
 	int ret;
 
 	ret = _pthread_mutex_unlock(mutex);
-	if (mutex != &witness_mtx) {
+	if (mutex != &witness_mtx && ret == 0) {
 		remove_lock(mutex);
 	}
 


More information about the svn-soc-all mailing list