Subject: Re: bug#64819: 30.0.50; condition-wait not interruptible

From: Helmut Eller <[email-masked]>
Date: Mon, 24 Jul 2023 14:58:37 +0200

On Mon, Jul 24 2023, Eli Zaretskii wrote:

> How will we know what to do with C-g if some thread runs Lisp, while
> one or more other threads are stuck in condition-wait? wouldn't you
> expect in this case to have C-g go to the running thread?

We could say that C-g sets quit-flag and causes all blocking calls to
condition-wait to return nil (spurious wakeup).  At that point all
threads are conceptually running.  Then the first thread (unspecified
which one) who calls maybe_quit() finishes handling C-g and clears
quit-flag afterwards.  Those threads who don't feel prepared to handle
C-g can bind inhibit-quit.

Helmut