Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jun 2002 17:19:10 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 12583 for review
Message-ID:  <200206090019.g590JAK92614@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=12583

Change 12583 by jhb@jhb_laptop on 2002/06/08 17:18:47

	Let witness complain about unlocking an unowned mutex before
	mtx_assert() since witness gives more informative information.

Affected files ...

... //depot/projects/smpng/sys/kern/kern_mutex.c#39 edit

Differences ...

==== //depot/projects/smpng/sys/kern/kern_mutex.c#39 (text+ko) ====

@@ -333,7 +333,6 @@
 {
 
 	MPASS(curthread != NULL);
-	mtx_assert(m, MA_OWNED);
 #ifdef MUTEX_PROFILING
 	if (m->acqtime != 0) {
 		static const char *unknown = "(unknown)";
@@ -391,6 +390,7 @@
  	WITNESS_UNLOCK(&m->mtx_object, opts | LOP_EXCLUSIVE, file, line);
 	LOCK_LOG_LOCK("UNLOCK", &m->mtx_object, opts, m->mtx_recurse, file,
 	    line);
+	mtx_assert(m, MA_OWNED);
 	_rel_sleep_lock(m, curthread, opts, file, line);
 }
 
@@ -414,10 +414,10 @@
 {
 
 	MPASS(curthread != NULL);
-	mtx_assert(m, MA_OWNED);
  	WITNESS_UNLOCK(&m->mtx_object, opts | LOP_EXCLUSIVE, file, line);
 	LOCK_LOG_LOCK("UNLOCK", &m->mtx_object, opts, m->mtx_recurse, file,
 	    line);
+	mtx_assert(m, MA_OWNED);
 #if defined(SMP) || LOCK_DEBUG > 0
 	_rel_spin_lock(m);
 #else

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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