diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index 67720f811ace..7cfef389024f 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -1700,10 +1700,12 @@ do_lock_pi(struct thread *td, struct umutex *m, uint32_t flags, * and we need to retry or we lost a race to the thread * unlocking the umtx. */ - if (old == owner) + if (old == owner) { error = umtxq_sleep_pi(uq, pi, owner & ~UMUTEX_CONTESTED, "umtxpi", timeout == NULL ? NULL : &timo); - else { + if (error != 0) + continue; + } else { umtxq_unbusy(&uq->uq_key); umtxq_unlock(&uq->uq_key); }