summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_mutex.c')
-rw-r--r--sys/kern/kern_mutex.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c
index 6847cde..95edd18 100644
--- a/sys/kern/kern_mutex.c
+++ b/sys/kern/kern_mutex.c
@@ -625,7 +625,7 @@ mtx_init(struct mtx *m, const char *description, int opts)
struct lock_object *lock;
MPASS((opts & ~(MTX_SPIN | MTX_QUIET | MTX_RECURSE |
- MTX_SLEEPABLE | MTX_NOWITNESS)) == 0);
+ MTX_SLEEPABLE | MTX_NOWITNESS | MTX_DUPOK)) == 0);
#ifdef MUTEX_DEBUG
/* Diagnostic and error correction */
@@ -649,6 +649,8 @@ mtx_init(struct mtx *m, const char *description, int opts)
lock->lo_flags |= LO_SLEEPABLE;
if ((opts & MTX_NOWITNESS) == 0)
lock->lo_flags |= LO_WITNESS;
+ if (opts & MTX_DUPOK)
+ lock->lo_flags |= LO_DUPOK;
m->mtx_lock = MTX_UNOWNED;
TAILQ_INIT(&m->mtx_blocked);
OpenPOWER on IntegriCloud