emacs-devel
[Top][All Lists]
Advanced

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

Why does this thread code crash my emacs?


From: Derek Davies
Subject: Why does this thread code crash my emacs?
Date: Fri, 15 Oct 2021 12:04:35 -0400
User-agent: mu4e 1.2.0; emacs 26.3


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)





reply via email to

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