parent
d9c128fe65
commit
0c8e3765f2
|
@ -1041,6 +1041,23 @@
|
||||||
;; make sure it's ok for rewind to be the first action:
|
;; make sure it's ok for rewind to be the first action:
|
||||||
(test (void) thread-wait (thread (lambda () (thread-rewind-receive '(1 2 3)))))
|
(test (void) thread-wait (thread (lambda () (thread-rewind-receive '(1 2 3)))))
|
||||||
|
|
||||||
|
(let* ([t (thread/suspend-to-kill
|
||||||
|
(lambda ()
|
||||||
|
(let loop ()
|
||||||
|
(sync
|
||||||
|
(handle-evt
|
||||||
|
(thread-receive-evt)
|
||||||
|
(λ (_)
|
||||||
|
(channel-put (thread-receive) 'ok)
|
||||||
|
(loop)))))))]
|
||||||
|
[res (for/list ([_ (in-range 2)])
|
||||||
|
(thread-suspend t)
|
||||||
|
(thread-resume t (current-thread))
|
||||||
|
(define ch (make-channel))
|
||||||
|
(thread-send t ch)
|
||||||
|
(channel-get ch))])
|
||||||
|
(test '(ok ok) values res))
|
||||||
|
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
;; Unsafe poller
|
;; Unsafe poller
|
||||||
|
|
||||||
|
|
|
@ -8085,7 +8085,7 @@
|
||||||
(begin-unsafe (queue-add-front! (thread-mailbox t_0) msg_0)))
|
(begin-unsafe (queue-add-front! (thread-mailbox t_0) msg_0)))
|
||||||
lst_0))
|
lst_0))
|
||||||
(end-atomic)))))))
|
(end-atomic)))))))
|
||||||
(define finish_2470
|
(define finish_2013
|
||||||
(make-struct-type-install-properties
|
(make-struct-type-install-properties
|
||||||
'(thread-receive-evt)
|
'(thread-receive-evt)
|
||||||
0
|
0
|
||||||
|
@ -8131,7 +8131,12 @@
|
||||||
(lambda (v_0) self_0)
|
(lambda (v_0) self_0)
|
||||||
(lambda () (set-thread-mailbox-wakeup! t_0 void))
|
(lambda () (set-thread-mailbox-wakeup! t_0 void))
|
||||||
(lambda () (set! receive_0 void))
|
(lambda () (set! receive_0 void))
|
||||||
(lambda () (add-wakeup-callback!_0)))))))))))))))
|
(lambda ()
|
||||||
|
(begin
|
||||||
|
(add-wakeup-callback!_0)
|
||||||
|
(if (is-mail? t_0)
|
||||||
|
(values self_0 #t)
|
||||||
|
(values #f #f)))))))))))))))))
|
||||||
(current-inspector)
|
(current-inspector)
|
||||||
#f
|
#f
|
||||||
'()
|
'()
|
||||||
|
@ -8146,7 +8151,7 @@
|
||||||
#f
|
#f
|
||||||
0
|
0
|
||||||
0))
|
0))
|
||||||
(define effect_2506 (finish_2470 struct:thread-receiver-evt))
|
(define effect_2506 (finish_2013 struct:thread-receiver-evt))
|
||||||
(define thread-receiver-evt26.1
|
(define thread-receiver-evt26.1
|
||||||
(|#%name|
|
(|#%name|
|
||||||
thread-receiver-evt
|
thread-receiver-evt
|
||||||
|
|
|
@ -1033,7 +1033,11 @@
|
||||||
;; abandon:
|
;; abandon:
|
||||||
(lambda () (set! receive void))
|
(lambda () (set! receive void))
|
||||||
;; retry (was interrupted, but not abandoned):
|
;; retry (was interrupted, but not abandoned):
|
||||||
(lambda () (add-wakeup-callback!))))])))
|
(lambda ()
|
||||||
|
(add-wakeup-callback!)
|
||||||
|
(if (is-mail? t)
|
||||||
|
(values self #t)
|
||||||
|
(values #f #f)))))])))
|
||||||
#:reflection-name 'thread-receive-evt)
|
#:reflection-name 'thread-receive-evt)
|
||||||
|
|
||||||
(define/who (thread-receive-evt)
|
(define/who (thread-receive-evt)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user