Fix the result-history vs console race condition

part of darcs patch Sun Sep 18 14:34:41 EEST 2005  Eric Knauel <knauel@informatik.uni-tuebingen.de>
This commit is contained in:
eknauel 2005-09-27 09:00:33 +00:00
parent 7c5db88473
commit 2ff942c985
2 changed files with 13 additions and 7 deletions

View File

@ -77,8 +77,9 @@
(lambda () (lambda ()
(sync (sync
(wrap (result-buffer-other-object-has-focus-rv) (wrap (result-buffer-other-object-has-focus-rv)
(lambda (ignore) (lambda (ack-channel)
(pause-console-output console))))))) (pause-console-output console)
(send ack-channel 'ignore)))))))
(define (make-console-viewer console buffer) (define (make-console-viewer console buffer)
(lambda (message) (lambda (message)

View File

@ -133,8 +133,10 @@
(make-channel)) (make-channel))
(define (signal-result-buffer-object-change) (define (signal-result-buffer-object-change)
(debug-message "signal-result-buffer-object-change") (let ((ack-channel (make-channel)))
(send result-buffer-changed-channel 'ignore)) (debug-message "signal-result-buffer-object-change")
(send result-buffer-changed-channel ack-channel)
(receive ack-channel)))
(define (spawn-result-buffer-surveillant) (define (spawn-result-buffer-surveillant)
(spawn (spawn
@ -144,11 +146,14 @@
(wrap (receive-rv result-buffer-changes-subscribers) (wrap (receive-rv result-buffer-changes-subscribers)
(lambda (answer-channel) (lambda (answer-channel)
(debug-message "result-buffer-surveillant 1") (debug-message "result-buffer-surveillant 1")
(receive result-buffer-changed-channel) (sync (wrap
(send answer-channel 'ignore) (receive-rv result-buffer-changed-channel)
(lambda (ack-channel)
(send answer-channel ack-channel))))
(lp))) (lp)))
(wrap (receive-rv result-buffer-changed-channel) (wrap (receive-rv result-buffer-changed-channel)
(lambda (ignore) (lambda (ack-channel)
(send ack-channel 'no-one-is-interested)
(debug-message "result-buffer-surveillant 2") (debug-message "result-buffer-surveillant 2")
(lp)))))))) (lp))))))))