Chez Scheme: sleep of non-positive duration now returns immediately

A negative duration would previously result in an infinite pause in
Windows.
This commit is contained in:
Bob Burger 2021-03-11 11:35:27 -05:00 committed by Matthew Flatt
parent 5e1df80a00
commit 31358698f3
2 changed files with 9 additions and 1 deletions

View File

@ -1961,6 +1961,12 @@ in fasl files does not generally make sense.
%-----------------------------------------------------------------------------
\section{Bug Fixes}\label{section:bugfixes}
\subsection{\protect\scheme{sleep} with negative duration (9.5.5)}
Prior to this release, \scheme{sleep} of a negative duration would
result in an infinite pause in Windows. Now \scheme{sleep} returns
immediately on all platforms when given a negative duration.
\subsection{Buffering signals (9.5.3)}
Prior to this release, only one unhandled signal was buffered for

View File

@ -771,7 +771,9 @@
(lambda (t)
(unless (and (time? t) (eq? (time-type t) 'time-duration))
($oops who "~s is not a time record of type time-duration" t))
(fp (time-second t) (time-nanosecond t)))))
(let ([s (time-second t)])
(when (>= s 0)
(fp s (time-nanosecond t)))))))
(define $scheme-greeting
(lambda ()