summaryrefslogtreecommitdiff
path: root/sys/kern/kern_mutex.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2003-03-04 21:32:25 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2003-03-04 21:32:25 +0000
commit1106937d9984785d5e6a6ddc342571bbd3c1202e (patch)
tree9e78abd003568a5f554962d6c4a4942c8600a14e /sys/kern/kern_mutex.c
parent4364d4c485bdad4d67da57dbfe79fb994ca177fe (diff)
Notes
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r--sys/kern/kern_mutex.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index d2d907f4dbc1..9f59577a33e4 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -454,8 +454,10 @@ _mtx_unlock_spin_flags(struct mtx *m, int opts, const char *file, int line)
/*
* The important part of mtx_trylock{,_flags}()
- * Tries to acquire lock `m.' We do NOT handle recursion here; we assume that
- * if we're called, it's because we know we don't already own this lock.
+ * Tries to acquire lock `m.' We do NOT handle recursion here. If this
+ * function is called on a recursed mutex, it will return failure and
+ * will not recursively acquire the lock. You are expected to know what
+ * you are doing.
*/
int
_mtx_trylock(struct mtx *m, int opts, const char *file, int line)
@@ -464,9 +466,6 @@ _mtx_trylock(struct mtx *m, int opts, const char *file, int line)
MPASS(curthread != NULL);
- KASSERT(!mtx_owned(m),
- ("mtx_trylock() called on a mutex already owned"));
-
rval = _obtain_lock(m, curthread);
LOCK_LOG_TRY("LOCK", &m->mtx_object, opts, rval, file, line);