From: Eli Zaretskii <eliz@gnu.org>
To: "Michał Krzywkowski" <mkrzywkow@gmail.com>
Cc: 37892@debbugs.gnu.org
Subject: bug#37892: 27.0.50; Crash when signaling a thread
Date: Sat, 26 Oct 2019 15:58:58 +0300 [thread overview]
Message-ID: <8336ffvf1p.fsf@gnu.org> (raw)
In-Reply-To: <87blu3lmfc.fsf@gmail.com> (message from Michał Krzywkowski on Sat, 26 Oct 2019 14:29:43 +0200)
> From: Michał Krzywkowski <mkrzywkow@gmail.com>
> Cc: Michał Krzywkowski <mkrzywkow@gmail.com>,
> 37892@debbugs.gnu.org
> Date: Sat, 26 Oct 2019 14:29:43 +0200
>
> Eli> Emacs doesn't allow signals while it waits for input.
>
> Eli> We could ignore thread-signal in such cases, or we could make it an
> Eli> error (which will then signal an error in the thread which called
> Eli> thread-signal). What do people think? Are there any other ideas for
> Eli> handling this situation?
>
> Maybe the signal should be raised in the thread right after it returns
> from sit-for?
We don't have any mechanism for doing that.
> Ignoring signals sounds like a bad idea.
It is better than crashing. It is also not much worse than
interrupting the thread at some arbitrary random point.
> Eli> Michał, can you tell why you needed to call thread-signal while the
> Eli> thread was in sit-for?
>
> I wanted to signal some background thread which was doing some work and
> then Emacs crashed, because it just so happened that it was in sit-for.
> The thread function was doing _more_ than just sit-for.
>
> I actually don't care (and can't know) what another thread is doing, I
> just want to send a signal to it.
But thread-signal is not for causing an error in a thread, it is for
unblocking a thread that waits on a mutex or a condvar. So why would
you use it when the thread is not blocked?
next prev parent reply other threads:[~2019-10-26 12:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-23 17:06 bug#37892: 27.0.50; Crash when signaling a thread Michał Krzywkowski
2019-10-25 8:44 ` Eli Zaretskii
2019-10-26 12:29 ` Michał Krzywkowski
2019-10-26 12:58 ` Eli Zaretskii [this message]
2019-10-27 10:16 ` Michał Krzywkowski
2019-10-27 13:25 ` Eli Zaretskii
2019-10-27 19:26 ` Michał Krzywkowski
2021-12-05 3:15 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8336ffvf1p.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=37892@debbugs.gnu.org \
--cc=mkrzywkow@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).