Subject: bug#36609: 27.0.50; Possible race-condition in threading implementation

From: Eli Zaretskii <[email-masked]>
Date: Fri, 12 Jul 2019 18:05:46 +0300

> From: Pip Cet <[email-masked]>
> Date: Fri, 12 Jul 2019 13:51:48 +0000
> Cc: [email-masked], [email-masked]
> 
> > If this is not the main thread, then the error handlers should be set
> > so as to log the error in last_thread_error, and then terminate the
> > thread (via exiting the thread function, AFAIR).
> 
> Indeed, that's what happens; but the thread now fails to release the
> GLib lock it had previously acquired, so other threads cannot acquire
> it again, ever.

Then we should make sure we release it when the thread function exits,
or before we call Fsignal from post_acquire_global_lock.  There's no
reason to use the unwind-protect machinery for that, I think.