all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Why does this thread code crash my emacs?
@ 2021-10-15 16:04 Derek Davies
  2021-10-15 18:45 ` dick
  2021-10-15 19:01 ` Eli Zaretskii
  0 siblings, 2 replies; 12+ messages in thread
From: Derek Davies @ 2021-10-15 16:04 UTC (permalink / raw)
  To: emacs-devel



Hi,


Working with the thread-signal example from:  https://emacs-berlin.org/thread-safe-tramp-2018-09.html

it works for me as given, but when I run hanoi instead of sleeping in
thread2 my emacs consistently crashes (back to command line from which
it was invoked).

I've been poking at it, but without much insight -- does anyone know
what I or hanoi or threading is doing wrong?

Thanks!
derek

GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw scroll bars) of 2020-02-04



;; 2.5 A thread could be signaled from another thread by thread-signal.

(defun my-thread1 ()
  (sleep-for 10)
  (thread-signal thread2 'error '(my-data)))

(defun my-thread2 ()
  (condition-case err
      (hanoi 11)
    (error (message "Thread %s signaled by `%s'" (current-thread) err))))

(setq thread1 (make-thread #'my-thread1 "my thread 1"))
(message "my thread1 %S" thread1)
  (setq thread2 (make-thread #'my-thread2 "my thread 2")))
(message "my thread2 %S" thread2)





^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-10-16 11:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-15 16:04 Why does this thread code crash my emacs? Derek Davies
2021-10-15 18:45 ` dick
2021-10-15 19:17   ` Eli Zaretskii
2021-10-15 19:56     ` dick
2021-10-16  7:06       ` tomas
2021-10-16  7:19       ` Eli Zaretskii
2021-10-16 10:53         ` dick
2021-10-16 11:12           ` Eli Zaretskii
2021-10-15 19:01 ` Eli Zaretskii
2021-10-15 22:17   ` Derek Davies
2021-10-16  0:08     ` dick
2021-10-16 11:51   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.