(define-package (gtk swat)
(parent (gtk))
(files "swat")
+ (import (runtime thread-queue)
+ thread-queue/peek-until)
(import (gtk gtk-widget)
gtk-widget-destroy-callback)
(import (gtk fix-layout)
thread-queue/queue-no-hang!
thread-queue/push!
thread-queue/dequeue!
- thread-queue/peek-no-hang
- thread-queue/peek-until
- thread-queue/peek))
+ thread-queue/dequeue-no-hang!
+ thread-queue/peek
+ thread-queue/peek-no-hang))
(define-package (runtime simple-file-ops)
(files "sfile")
#f)
(%queue! queue item))))
-(define (thread-queue/dequeue-no-hang queue msec)
- (guarantee-thread-queue queue 'thread-queue/dequeue-no-hang)
- (guarantee-non-negative-fixnum msec 'thread-queue/dequeue-no-hang)
- (thread-queue/dequeue-until
+(define (thread-queue/dequeue-no-hang! queue msec)
+ (guarantee-thread-queue queue 'thread-queue/dequeue-no-hang!)
+ (guarantee-non-negative-fixnum msec 'thread-queue/dequeue-no-hang!)
+ (thread-queue/dequeue-until!
queue (+ (real-time-clock) (internal-time/seconds->ticks (/ msec 1000)))))
-(define (thread-queue/dequeue-until queue time)
- (guarantee-thread-queue queue 'thread-queue/dequeue-until)
- (guarantee-integer time 'thread-queue/dequeue-until)
+(define (thread-queue/dequeue-until! queue time)
+ (guarantee-thread-queue queue 'thread-queue/dequeue-until!)
+ (guarantee-integer time 'thread-queue/dequeue-until!)
(when-non-empty-before time queue %dequeue!))
(declare (integrate-operator when-non-empty-before))
(if (<= time now)
#f
(begin
+ (set-%thread-queue/waiting-dequeuers!
+ queue (append! (%thread-queue/waiting-dequeuers queue)
+ (list (current-thread))))
(register-timer-event (- time now) (lambda () unspecific))
(suspend-current-thread)
(loop)))))))))