emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107350: Avoid a race condition in ur


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107350: Avoid a race condition in url-queue-kill-job
Date: Mon, 20 Feb 2012 13:12:48 +0100
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107350
committer: Lars Ingebrigtsen <address@hidden>
branch nick: trunk
timestamp: Mon 2012-02-20 13:12:48 +0100
message:
  Avoid a race condition in url-queue-kill-job
  
  * url-queue.el (url-queue-kill-job): Delete the process sentinel
  before killing the process to avoid a race condition between the
  two processes killing off the process buffer.
modified:
  lisp/url/ChangeLog
  lisp/url/url-queue.el
=== modified file 'lisp/url/ChangeLog'
--- a/lisp/url/ChangeLog        2012-02-20 08:22:41 +0000
+++ b/lisp/url/ChangeLog        2012-02-20 12:12:48 +0000
@@ -1,5 +1,9 @@
 2012-02-20  Lars Ingebrigtsen  <address@hidden>
 
+       * url-queue.el (url-queue-kill-job): Delete the process sentinel
+       before killing the process to avoid a race condition between the
+       two processes killing off the process buffer.
+
        * url.el (url-retrieve-internal): Warn about file errors when
        pruning the cache instead of bugging out (bug#10831).
 

=== modified file 'lisp/url/url-queue.el'
--- a/lisp/url/url-queue.el     2012-02-19 08:49:09 +0000
+++ b/lisp/url/url-queue.el     2012-02-20 12:12:48 +0000
@@ -152,9 +152,11 @@
 
 (defun url-queue-kill-job (job)
   (when (bufferp (url-queue-buffer job))
-    (while (get-buffer-process (url-queue-buffer job))
-      (ignore-errors
-       (delete-process (get-buffer-process (url-queue-buffer job)))))
+    (let (process)
+      (while (setq process (get-buffer-process (url-queue-buffer job)))
+       (set-process-sentinel process 'ignore)
+       (ignore-errors
+         (delete-process process))))
     (ignore-errors
       (kill-buffer (url-queue-buffer job)))))
 


reply via email to

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