]>
git.eshelyaron.com Git - emacs.git/commit
run-in-thread accepts a new optional argument: nolock.
When it is no-nil the thread does not try to get a lock on the current
buffer before work on it.
With this change, the following example works quite smoothly; while
loading imap folders, gnus yields to another thread:
(load-library "gnus")
;; Redefine to use yield
(defun imap-send-command-wait (command &optional buffer)
(imap-wait-for-tag (prog1 (imap-send-command command buffer) (yield)) buffer))
(progn
(run-in-thread '(gnus) t)
(dotimes (i 20)
;; yield is called automatically during a buffer-switch
(message (format "I got here %i" i))))