cs & io: fix UDP receive poller registration

Closes #3590
This commit is contained in:
Matthew Flatt 2020-12-30 05:01:25 -07:00
parent dbe36162ac
commit 15bda57d77
3 changed files with 13 additions and 3 deletions

View File

@ -195,6 +195,16 @@
(test #f sync/timeout 0.05 udp2-r)
(test #f sync/timeout 0.05 (udp-receive!-evt udp2 us1))
(test #f sync/timeout 0.05 (udp-receive!-evt udp2 (make-bytes 0)))
(when (run-unreliable-tests? 'timing)
(let loop ([retries 5])
(if (zero? retries)
(test #t 'udp-receive-evt-does-not-spin #f)
(let ([start (current-process-milliseconds)]
[wait 0.05])
(test #f sync/timeout wait (udp-receive!-evt udp2 (make-bytes 0)))
(or (< (- (current-process-milliseconds) start)
(/ wait 5))
(loop (sub1 retries)))))))
;; break behavior
(let ([t (parameterize-break #f

View File

@ -37414,7 +37414,7 @@
(define cell.2 (unsafe-make-place-local ""))
(define struct:udp-receiving-evt
(make-record-type-descriptor* 'udp-receive-evt #f #f #f #f 2 0))
(define effect_2721
(define effect_2847
(struct-type-install-properties!
struct:udp-receiving-evt
'udp-receive-evt
@ -37449,7 +37449,7 @@
(unsafe-place-local-ref cell.1)
(udp-s (|#%app| udp-receiving-evt-u self_0))
ps_0
2)))
1)))
(values #f self_0))))))))))))
(current-inspector)
#f

View File

@ -149,7 +149,7 @@
(sandman-poll-ctx-add-poll-set-adder!
poll-ctx
(lambda (ps)
(rktio_poll_add rktio (udp-s (udp-receiving-evt-u self)) ps RKTIO_POLL_WRITE)))
(rktio_poll_add rktio (udp-s (udp-receiving-evt-u self)) ps RKTIO_POLL_READ)))
(values #f self)])]))))
#:reflection-name 'udp-receive-evt
#:authentic)