@@ -655,7 +655,18 @@ closes @racket[in].}
655655Returns a @tech{synchronizable event} that is ready when
656656@racket[in] produces an @racket[eof]. If @racket[in] produces a
657657mid-stream @racket[eof], the @racket[eof] is consumed by the event
658- only if the event is chosen in a synchronization.}
658+ only if the event is chosen in a synchronization.
659+
660+ If attempting to read from @racket[in] raises an exception during a
661+ synchronization attempt, then the exception may be reported during the
662+ synchronization attempt, but it will silently discarded if some another
663+ event in the same synchronization is selected or if some other event
664+ raises an exception first.
665+
666+ @history[#:changed "7.5.0.3 " @elem{Changed handling of read errors so
667+ they are propagated to a synchronization attempt,
668+ instead of treated as unhandled errors in a
669+ background thread.}]}
659670
660671
661672@defproc[(read-bytes-evt [k exact-nonnegative-integer?] [in input-port?])
@@ -681,12 +692,14 @@ concurrently---and each synchronization corresponds to a distinct read
681692request.
682693
683694The @racket[in] must support progress events, and it must not produce
684- a special non-byte value during the read attempt.}
695+ a special non-byte value during the read attempt.
696+
697+ Exceptions attempting to read from @racket[in] are handled in the same
698+ way as by @racket[eof-evt].}
685699
686700
687701@defproc[(read-bytes!-evt [bstr (and/c bytes? (not/c immutable?))]
688- [in input-port?]
689- [progress-evt (or/c progress-evt? #f )])
702+ [in input-port?])
690703 evt?]{
691704
692705Like @racket[read-bytes-evt], except that the read bytes are placed
@@ -703,7 +716,10 @@ might be mutated if the event is not selected by a synchronzation;
703716nevertheless, multiple synchronization attempts can use the same
704717result from @racket[read-bytes!-evt] as long as there is no
705718intervening read on @racket[in] until one of the synchronization
706- attempts selects the event.}
719+ attempts selects the event.
720+
721+ Exceptions attempting to read from @racket[in] are handled in the same
722+ way as by @racket[eof-evt].}
707723
708724
709725@defproc[(read-bytes-avail!-evt [bstr (and/c bytes? (not/c immutable?))] [in input-port?])
@@ -730,7 +746,7 @@ a byte string.}
730746
731747
732748@defproc[(read-line-evt [in input-port?]
733- [mode (or/c 'linefeed 'return 'return-linefeed 'any 'any-one )])
749+ [mode (or/c 'linefeed 'return 'return-linefeed 'any 'any-one ) 'linefeed ])
734750 evt?]{
735751
736752Returns a @tech{synchronizable event} that is ready when a line of
@@ -741,11 +757,14 @@ separator).
741757
742758A line is read from the port if and only if the event is chosen in a
743759synchronization, and the returned line always represents contiguous
744- bytes in the port's stream.}
760+ bytes in the port's stream.
761+
762+ Exceptions attempting to read from @racket[in] are handled in the same
763+ way as by @racket[eof-evt].}
745764
746765
747766@defproc[(read-bytes-line-evt [in input-port?]
748- [mode (or/c 'linefeed 'return 'return-linefeed 'any 'any-one )])
767+ [mode (or/c 'linefeed 'return 'return-linefeed 'any 'any-one ) 'linefeed ])
749768 evt?]{
750769
751770Like @racket[read-line-evt], but returns a byte string instead of a
@@ -762,7 +781,7 @@ string.}
762781 [(peek-string!-evt [str (and/c string? (not/c immutable?))] [skip exact-nonnegative-integer?]
763782 [progress-evt (or/c progress-evt? #f )] [in input-port?]) evt?])]{
764783
765- Like the @racket[read-... -evt] functions, but for peeking. The
784+ Like the @racket[read-bytes -evt], etc., functions, but for peeking. The
766785@racket[skip] argument indicates the number of bytes to skip, and
767786@racket[progress-evt] indicates an event that effectively cancels the peek
768787(so that the event never becomes ready). The @racket[progress-evt]
@@ -796,7 +815,10 @@ each synchronization corresponds to a distinct match request.
796815
797816The @racket[in] port must support progress events. If @racket[in]
798817returns a special non-byte value during the match attempt, it is
799- treated like @racket[eof].}
818+ treated like @racket[eof].
819+
820+ Exceptions attempting to read from @racket[in] are handled in the same
821+ way as by @racket[eof-evt].}
800822
801823@; ----------------------------------------------------------------------
802824
0 commit comments