Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 May 2011 15:08:30 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r222060 - in user/avg/xcpu/sys: kern sys
Message-ID:  <201105181508.p4IF8UoS096841@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Wed May 18 15:08:30 2011
New Revision: 222060
URL: http://svn.freebsd.org/changeset/base/222060

Log:
  pick even better name for the panic thread macro
  
  Hopefully this is a final choice.
  
  Suggested by:	mdf

Modified:
  user/avg/xcpu/sys/kern/kern_mutex.c
  user/avg/xcpu/sys/kern/kern_rmlock.c
  user/avg/xcpu/sys/kern/kern_rwlock.c
  user/avg/xcpu/sys/kern/kern_sx.c
  user/avg/xcpu/sys/kern/kern_synch.c
  user/avg/xcpu/sys/sys/proc.h

Modified: user/avg/xcpu/sys/kern/kern_mutex.c
==============================================================================
--- user/avg/xcpu/sys/kern/kern_mutex.c	Wed May 18 15:07:36 2011	(r222059)
+++ user/avg/xcpu/sys/kern/kern_mutex.c	Wed May 18 15:08:30 2011	(r222060)
@@ -348,7 +348,7 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t
 		return;
 	}
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	lock_profile_obtain_lock_failed(&m->lock_object,
@@ -510,7 +510,7 @@ _mtx_lock_spin(struct mtx *m, uintptr_t 
 	uint64_t waittime = 0;
 #endif
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	if (LOCK_LOG_TEST(&m->lock_object, opts))
@@ -584,7 +584,7 @@ retry:
 				break;
 			}
 
-			if (THREAD_PANICKED())
+			if (TD_IS_INPANIC())
 				return;
 
 			lock_profile_obtain_lock_failed(&m->lock_object,
@@ -673,7 +673,7 @@ _mtx_unlock_sleep(struct mtx *m, int opt
 		return;
 	}
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	/*

Modified: user/avg/xcpu/sys/kern/kern_rmlock.c
==============================================================================
--- user/avg/xcpu/sys/kern/kern_rmlock.c	Wed May 18 15:07:36 2011	(r222059)
+++ user/avg/xcpu/sys/kern/kern_rmlock.c	Wed May 18 15:08:30 2011	(r222060)
@@ -279,7 +279,7 @@ _rm_rlock_hard(struct rmlock *rm, struct
 		return (1);
 	}
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return (1);
 
 	/*
@@ -388,7 +388,7 @@ _rm_unlock_hard(struct thread *td,struct
 	if (!tracker->rmp_flags)
 		return;
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	mtx_lock_spin(&rm_spinlock);
@@ -442,7 +442,7 @@ _rm_wlock(struct rmlock *rm)
 	else
 		mtx_lock(&rm->rm_lock_mtx);
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	if (rm->rm_writecpus != all_cpus) {

Modified: user/avg/xcpu/sys/kern/kern_rwlock.c
==============================================================================
--- user/avg/xcpu/sys/kern/kern_rwlock.c	Wed May 18 15:07:36 2011	(r222059)
+++ user/avg/xcpu/sys/kern/kern_rwlock.c	Wed May 18 15:08:30 2011	(r222060)
@@ -323,7 +323,7 @@ _rw_rlock(struct rwlock *rw, const char 
 	    rw->lock_object.lo_name, file, line));
 	WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL);
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	for (;;) {
@@ -535,7 +535,7 @@ _rw_runlock(struct rwlock *rw, const cha
 	WITNESS_UNLOCK(&rw->lock_object, 0, file, line);
 	LOCK_LOG_LOCK("RUNLOCK", &rw->lock_object, 0, 0, file, line);
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	/* TODO: drop "owner of record" here. */
@@ -665,7 +665,7 @@ _rw_wlock_hard(struct rwlock *rw, uintpt
 		return;
 	}
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	if (LOCK_LOG_TEST(&rw->lock_object, 0))
@@ -829,7 +829,7 @@ _rw_wunlock_hard(struct rwlock *rw, uint
 		return;
 	}
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	KASSERT(rw->rw_lock & (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS),

Modified: user/avg/xcpu/sys/kern/kern_sx.c
==============================================================================
--- user/avg/xcpu/sys/kern/kern_sx.c	Wed May 18 15:07:36 2011	(r222059)
+++ user/avg/xcpu/sys/kern/kern_sx.c	Wed May 18 15:08:30 2011	(r222060)
@@ -493,7 +493,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t 
 		return (0);
 	}
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return (0);
 
 	if (LOCK_LOG_TEST(&sx->lock_object, 0))
@@ -695,7 +695,7 @@ _sx_xunlock_hard(struct sx *sx, uintptr_
 		return;
 	}
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	MPASS(sx->sx_lock & (SX_LOCK_SHARED_WAITERS |
@@ -760,7 +760,7 @@ _sx_slock_hard(struct sx *sx, int opts, 
 	int64_t sleep_time = 0;
 #endif
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return (0);
 
 	/*
@@ -929,7 +929,7 @@ _sx_sunlock_hard(struct sx *sx, const ch
 	uintptr_t x;
 	int wakeup_swapper;
 
-	if (THREAD_PANICKED())
+	if (TD_IS_INPANIC())
 		return;
 
 	for (;;) {

Modified: user/avg/xcpu/sys/kern/kern_synch.c
==============================================================================
--- user/avg/xcpu/sys/kern/kern_synch.c	Wed May 18 15:07:36 2011	(r222059)
+++ user/avg/xcpu/sys/kern/kern_synch.c	Wed May 18 15:08:30 2011	(r222060)
@@ -158,7 +158,7 @@ _sleep(void *ident, struct lock_object *
 	else
 		class = NULL;
 
-	if (cold || THREAD_PANICKED()) {
+	if (cold || TD_IS_INPANIC()) {
 		/*
 		 * During autoconfiguration, just return;
 		 * don't run any other threads or panic below,
@@ -260,7 +260,7 @@ msleep_spin(void *ident, struct mtx *mtx
 	KASSERT(p != NULL, ("msleep1"));
 	KASSERT(ident != NULL && TD_IS_RUNNING(td), ("msleep"));
 
-	if (cold || THREAD_PANICKED()) {
+	if (cold || TD_IS_INPANIC()) {
 		/*
 		 * During autoconfiguration, just return;
 		 * don't run any other threads or panic below,

Modified: user/avg/xcpu/sys/sys/proc.h
==============================================================================
--- user/avg/xcpu/sys/sys/proc.h	Wed May 18 15:07:36 2011	(r222059)
+++ user/avg/xcpu/sys/sys/proc.h	Wed May 18 15:08:30 2011	(r222060)
@@ -781,7 +781,7 @@ MALLOC_DECLARE(M_SUBPROC);
  * Otherwise, the kernel will deadlock since the scheduler isn't
  * going to run the thread that holds the lock we need.
  */
-#define	THREAD_PANICED()	\
+#define	TD_IS_INPANIC()	\
 	(panicstr != NULL && (curthread->td_flags & TDF_INPANIC) != 0)
 
 



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