diff options
-rw-r--r-- | sys/kern/kern_lock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 01e0a567b82..53a6603ff7a 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lock.c,v 1.61 2018/03/27 08:32:29 mpi Exp $ */ +/* $OpenBSD: kern_lock.c,v 1.62 2018/04/25 10:30:41 mpi Exp $ */ /* * Copyright (c) 2017 Visa Hankala @@ -262,10 +262,6 @@ __mtx_enter(struct mutex *mtx) int nticks = __mp_lock_spinout; #endif - /* Avoid deadlocks after panic or in DDB */ - if (panicstr || db_active) - return; - while (__mtx_enter_try(mtx) == 0) { CPU_BUSY_CYCLE(); @@ -285,6 +281,10 @@ __mtx_enter_try(struct mutex *mtx) struct cpu_info *owner, *ci = curcpu(); int s; + /* Avoid deadlocks after panic or in DDB */ + if (panicstr || db_active) + return (1); + if (mtx->mtx_wantipl != IPL_NONE) s = splraise(mtx->mtx_wantipl); |