#| -*-Scheme-*-
-$Id: io.scm,v 14.58 1999/02/16 05:38:22 cph Exp $
+$Id: io.scm,v 14.59 1999/02/24 21:57:06 cph Exp $
Copyright (c) 1988-1999 Massachusetts Institute of Technology
buffer start end))))
(declare (integrate-operator do-read))
(if (and have-select? (not (channel-type=file? channel)))
- (let ((block-events? (block-thread-events)))
- (let ((result
- (let ((do-test
- (lambda (k)
- (let ((result (test-for-input-on-channel channel)))
- (case result
- ((INPUT-AVAILABLE)
- (do-read))
- ((PROCESS-STATUS-CHANGE)
- (handle-subprocess-status-change)
- (if (channel-closed? channel) 0 (k)))
- (else
- (k)))))))
- (if (channel-blocking? channel)
- (let loop () (do-test loop))
- (do-test (lambda () #f))))))
- (if (not block-events?)
- (unblock-thread-events))
- result))
+ (with-thread-events-blocked
+ (lambda ()
+ (let ((do-test
+ (lambda (k)
+ (let ((result (test-for-input-on-channel channel)))
+ (case result
+ ((INPUT-AVAILABLE)
+ (do-read))
+ ((PROCESS-STATUS-CHANGE)
+ (handle-subprocess-status-change)
+ (if (channel-closed? channel) 0 (k)))
+ (else
+ (k)))))))
+ (if (channel-blocking? channel)
+ (let loop () (do-test loop))
+ (do-test (lambda () #f))))))
(do-read))))
(define (channel-read-block channel buffer start end)
#| -*-Scheme-*-
-$Id: os2graph.scm,v 1.14 1999/01/02 06:11:34 cph Exp $
+$Id: os2graph.scm,v 1.15 1999/02/24 21:57:12 cph Exp $
Copyright (c) 1995-1999 Massachusetts Institute of Technology
(error "Unknown font name:" font-specifier))
metrics)))
-(define (without-thread-events thunk)
- (let ((block-events? (block-thread-events)))
- (let ((value (thunk)))
- (if (not block-events?)
- (unblock-thread-events))
- value)))
-
(define (fix:vector-min v)
(let ((length (vector-length v))
(min (vector-ref v 0)))
(define (pm-synchronize)
(os2pm-synchronize)
- (without-thread-events (lambda () (do () ((not (read-and-process-event)))))))
+ (with-thread-events-blocked
+ (lambda () (do () ((not (read-and-process-event)))))))
(define (read-and-process-event)
(let ((event (os2win-get-event event-descriptor #f)))
(define (os2-graphics/read-user-event device)
device
- (without-thread-events
+ (with-thread-events-blocked
(lambda ()
(let loop ()
(if (queue-empty? user-event-queue)
(define (os2-graphics/discard-events device)
device
- (without-thread-events
+ (with-thread-events-blocked
(lambda ()
(let loop ()
(flush-queue! user-event-queue)
#| -*-Scheme-*-
-$Id: x11graph.scm,v 1.48 1999/01/02 06:19:10 cph Exp $
+$Id: x11graph.scm,v 1.49 1999/02/24 21:57:17 cph Exp $
Copyright (c) 1989-1999 Massachusetts Institute of Technology
registration))
(define (read-event display)
- (let ((queue (x-display/event-queue display))
- (block-events? (block-thread-events)))
- (let ((event
- (let loop ()
- (if (queue-empty? queue)
- (begin
- (%read-and-process-event display)
- (loop))
- (dequeue! queue)))))
- (if (not block-events?)
- (unblock-thread-events))
- event)))
+ (letrec ((loop
+ (let ((queue (x-display/event-queue display)))
+ (lambda ()
+ (if (queue-empty? queue)
+ (begin
+ (%read-and-process-event display)
+ (loop))
+ (dequeue! queue))))))
+ (with-thread-events-blocked loop)))
(define (%read-and-process-event display)
(let ((event
(process-event display event))))
(define (discard-events display)
- (let ((queue (x-display/event-queue display))
- (block-events? (block-thread-events)))
- (let loop ()
- (cond ((not (queue-empty? queue))
- (dequeue! queue)
- (loop))
- ((x-display-process-events (x-display/xd display) 2)
- =>
- (lambda (event)
- (process-event display event)
- (loop)))))
- (if (not block-events?)
- (unblock-thread-events))))
+ (letrec ((loop
+ (let ((queue (x-display/event-queue display)))
+ (lambda ()
+ (cond ((not (queue-empty? queue))
+ (dequeue! queue)
+ (loop))
+ ((x-display-process-events (x-display/xd display) 2)
+ =>
+ (lambda (event)
+ (process-event display event)
+ (loop))))))))
+ (with-thread-events-blocked loop)))
\f
(define (process-event display event)
(without-interrupts
(if (not (boolean? (x-window/mapped? window)))
(begin
(x-window-flush xw)
- (let ((block-events? (block-thread-events))
- (display (x-window/display window)))
- (let loop ()
- (if (not (eq? #t (x-window/mapped? window)))
- (begin
- (%read-and-process-event display)
- (loop))))
- (if (not block-events?)
- (unblock-thread-events)))))))
+ (letrec ((loop
+ (let ((display (x-window/display window)))
+ (lambda ()
+ (if (not (eq? #t (x-window/mapped? window)))
+ (begin
+ (%read-and-process-event display)
+ (loop)))))))
+ (with-thread-events-blocked loop))))))
(define (decode-suppress-map-arg suppress-map? procedure)
(cond ((boolean? suppress-map?)