emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#55356: closed (join-thread unusable if timeout was hit)


From: GNU bug Tracking System
Subject: bug#55356: closed (join-thread unusable if timeout was hit)
Date: Thu, 25 Jan 2024 22:15:02 +0000

Your message dated Thu, 25 Jan 2024 23:14:26 +0100
with message-id <87fryloybh.fsf@gnu.org>
and subject line Re: bug#61058: [PATCH v2] Fix asymetric mutex locking when 
joining thread.
has caused the debbugs.gnu.org bug report #55356,
regarding join-thread unusable if timeout was hit
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
55356: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55356
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: join-thread unusable if timeout was hit Date: Tue, 10 May 2022 20:42:03 -0400 User-agent: mu4e 1.6.10; emacs 29.0.50
If join-thread is called after a previous call to join-thread hits the timeout, 
a "mutex already locked by thread" error is thrown.

Working example:

(use-modules (ice-9 threads))
(define t (call-with-new-thread
           (lambda _
             (let r ()
               (sleep 1)
               (r)))))
(join-thread t (current-time))
(join-thread t (current-time)) ;; exception here

my guile version: latest git. cc455976813ab94de121395982435430874cbf58
my OS: guix on amd64



--- End Message ---
--- Begin Message --- Subject: Re: bug#61058: [PATCH v2] Fix asymetric mutex locking when joining thread. Date: Thu, 25 Jan 2024 23:14:26 +0100 User-agent: Gnus/5.13 (Gnus v5.13)
Hello,

Olivier Dion <olivier.dion@polymtl.ca> skribis:

> If `join-thread' timeout, the thread mutex is not unlocked, resulting in
> deadlock to the next call to it or deadlock of the thread itself when it
> terminates.
>
> Thus, always unlock the mutex.
>
> Fix: #55356
>
> * module/ice-9/threads.scm (join-thread): Always unlock thread mutex.
> * test-suite/tests/threads.test (join-thread): New test to ensure the
> mutex is released

Pushed as 455ee49f5573baa1bc5237a8d49083ce588a13ee with a ‘NEWS’ entry
and an additional comment in the test.

Thanks!

Ludo’.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]