[Bug 254995] pthread_cond_timedwait() returns EDEADLK

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 09 Oct 2021 19:52:04 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254995

--- Comment #10 from Konstantin Belousov <kib@FreeBSD.org> ---
(In reply to nkoch from comment #9)
Perhaps try this.  Still, since you are claiming that there is no stop signals,
it should not matter.


commit 98a2fa4a342983bee7f1700530fd721652ce27b5
Author: Konstantin Belousov <kib@FreeBSD.org>
Date:   Sat Oct 9 22:46:08 2021 +0300

    umtx: Do not return spurious failures on unlock after suspend for normal or
PI mutexes

diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c
index ea87259161c8..359318b3849e 100644
--- a/sys/kern/kern_umtx.c
+++ b/sys/kern/kern_umtx.c
@@ -1486,7 +1486,7 @@ do_unlock_normal(struct thread *td, struct umutex *m,
uint32_t flags, bool rb)
                if (error == -1)
                        return (EFAULT);
                if (error == 1) {
-                       error = thread_check_susp(td, false);
+                       error = thread_check_susp(td, true);
                        if (error != 0)
                                return (error);
                        goto again;
@@ -1523,7 +1523,7 @@ do_unlock_normal(struct thread *td, struct umutex *m,
uint32_t flags, bool rb)
        if (error == 1) {
                if (old != owner)
                        return (EINVAL);
-               error = thread_check_susp(td, false);
+               error = thread_check_susp(td, true);
                if (error != 0)
                        return (error);
                goto again;
@@ -2428,7 +2428,7 @@ do_unlock_pi(struct thread *td, struct umutex *m,
uint32_t flags, bool rb)
 again:
        error = casueword32(&m->m_owner, owner, &old, new_owner);
        if (error == 1) {
-               error = thread_check_susp(td, false);
+               error = thread_check_susp(td, true);
                if (error == 0)
                        goto again;
        }

-- 
You are receiving this mail because:
You are the assignee for the bug.