summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mutex.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2012-09-13 22:26:22 +0000
committerattilio <attilio@FreeBSD.org>2012-09-13 22:26:22 +0000
commitd63ec4c4ce1de03b00bdd4813aeee11ee77907ea (patch)
tree98cf642eabc284875d15c5dcbebba86797df11e9 /sys/kern/kern_mutex.c
parent5bb226a48fff4750ea9116c30966dec033b67f4c (diff)
downloadFreeBSD-src-d63ec4c4ce1de03b00bdd4813aeee11ee77907ea.zip
FreeBSD-src-d63ec4c4ce1de03b00bdd4813aeee11ee77907ea.tar.gz
Remove all the checks on curthread != NULL with the exception of some MD
trap checks (eg. printtrap()). Generally this check is not needed anymore, as there is not a legitimate case where curthread != NULL, after pcpu 0 area has been properly initialized. Reviewed by: bde, jhb MFC after: 1 week
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r--sys/kern/kern_mutex.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index 9827a9f..2ab7a09 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -200,7 +200,6 @@ _mtx_lock_flags(struct mtx *m, int opts, const char *file, int line)
if (SCHEDULER_STOPPED())
return;
- MPASS(curthread != NULL);
KASSERT(!TD_IS_IDLETHREAD(curthread),
("mtx_lock() by idle thread %p on sleep mutex %s @ %s:%d",
curthread, m->lock_object.lo_name, file, line));
@@ -225,7 +224,6 @@ _mtx_unlock_flags(struct mtx *m, int opts, const char *file, int line)
if (SCHEDULER_STOPPED())
return;
- MPASS(curthread != NULL);
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_unlock() of destroyed mutex @ %s:%d", file, line));
KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_sleep,
@@ -248,7 +246,6 @@ _mtx_lock_spin_flags(struct mtx *m, int opts, const char *file, int line)
if (SCHEDULER_STOPPED())
return;
- MPASS(curthread != NULL);
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_lock_spin() of destroyed mutex @ %s:%d", file, line));
KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin,
@@ -272,7 +269,6 @@ _mtx_unlock_spin_flags(struct mtx *m, int opts, const char *file, int line)
if (SCHEDULER_STOPPED())
return;
- MPASS(curthread != NULL);
KASSERT(m->mtx_lock != MTX_DESTROYED,
("mtx_unlock_spin() of destroyed mutex @ %s:%d", file, line));
KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin,
@@ -303,7 +299,6 @@ mtx_trylock_flags_(struct mtx *m, int opts, const char *file, int line)
if (SCHEDULER_STOPPED())
return (1);
- MPASS(curthread != NULL);
KASSERT(!TD_IS_IDLETHREAD(curthread),
("mtx_trylock() by idle thread %p on sleep mutex %s @ %s:%d",
curthread, m->lock_object.lo_name, file, line));
OpenPOWER on IntegriCloud