From f660349e697daccdf63b375a1be5949277f88ccd Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Mon, 27 Sep 2010 23:42:11 +0000 Subject: [PATCH] 1.0.42.54: #!+darwin the nanosleep hack * At least on linux the the output value of nanosleep can drift up a little bit compared to the input. Combined with the hack for the darwin nanosleep problems, this caused early exits from SLEEP. --- src/code/unix.lisp | 13 ++++++++++--- version.lisp-expr | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/code/unix.lisp b/src/code/unix.lisp index 47eba3d..7bb9929 100644 --- a/src/code/unix.lisp +++ b/src/code/unix.lisp @@ -926,9 +926,16 @@ corresponds to NAME, or NIL if there is none." ;; return with EINT and (unsigned)-1 seconds in the ;; remainder timespec, which would cause us to enter ;; nanosleep again for ~136 years. So, we check that the - ;; remainder time is actually decreasing. Since the cost - ;; of this check is neglible, do it on all platforms. - ;; http://osdir.com/ml/darwin-kernel/2010-03/msg00007.html + ;; remainder time is actually decreasing. + ;; + ;; It would be neat to do this bit of defensive + ;; programming on all platforms, but unfortunately on + ;; Linux, REM can be a little higher than REQ if the + ;; nanosleep() call is interrupted quickly enough, + ;; probably due to the request being rounded up to the + ;; nearest HZ. This would cause the sleep to return way + ;; too early. + #!+darwin (let ((rem-sec (slot rem 'tv-sec)) (rem-nsec (slot rem 'tv-nsec))) (when (or (> secs rem-sec) diff --git a/version.lisp-expr b/version.lisp-expr index 864d80d..dfeae0f 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.42.53" +"1.0.42.54" -- 1.7.10.4