diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 6c914ab6f3ea..08bdd1a1a9aa 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -723,13 +723,11 @@ umtxq_check_susp(struct thread *td, bool sleep) error = 0; p = td->td_proc; PROC_LOCK(p); - if (P_SHOULDSTOP(p) || - ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND))) { - if (p->p_flag & P_SINGLE_EXIT) - error = EINTR; - else - error = sleep ? thread_suspend_check(0) : ERESTART; - } + if (p->p_flag & P_SINGLE_EXIT) + error = EINTR; + else if (P_SHOULDSTOP(p) || + ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND))) + error = sleep ? thread_suspend_check(0) : ERESTART; PROC_UNLOCK(p); return (error); }