]> git.eshelyaron.com Git - emacs.git/commit
run-in-thread accepts a new optional argument: nolock.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Fri, 18 Sep 2009 20:16:30 +0000 (22:16 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Fri, 18 Sep 2009 20:16:30 +0000 (22:16 +0200)
commit4a5034451ea883ddffaca58b1d741cfe8170decb
treeb06e5841ee8c5d1488d52897f1a0d75238dc26e9
parentb923747ac5e88e0c32b1b320e977432b24101dbe
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))))
src/buffer.c
src/thread.c
src/thread.h