This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=8d124d207738be0b43dfc235a5d72519a2ab5db9 The branch, stable-2.0 has been updated via 8d124d207738be0b43dfc235a5d72519a2ab5db9 (commit) from 972fb41f0ce124d97f5cf64bde1075510cd21e18 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8d124d207738be0b43dfc235a5d72519a2ab5db9 Author: Nathaniel Alderson <[email protected]> Date: Thu Sep 19 14:02:26 2013 -0700 Calculate usecs correctly in thread-sleep! * module/srfi/srfi-18.scm (thread-sleep!): Correctly compute microseconds. * test-suite/tests/srfi-18.test: Add test. ----------------------------------------------------------------------- Summary of changes: module/srfi/srfi-18.scm | 2 +- test-suite/tests/srfi-18.test | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/module/srfi/srfi-18.scm b/module/srfi/srfi-18.scm index 5b5b2a6..01550c3 100644 --- a/module/srfi/srfi-18.scm +++ b/module/srfi/srfi-18.scm @@ -236,7 +236,7 @@ (list timeout) '())))) (secs (inexact->exact (truncate t))) - (usecs (inexact->exact (truncate (* (- t secs) 1000))))) + (usecs (inexact->exact (truncate (* (- t secs) 1000000))))) (and (> secs 0) (sleep secs)) (and (> usecs 0) (usleep usecs)) *unspecified*)) diff --git a/test-suite/tests/srfi-18.test b/test-suite/tests/srfi-18.test index 47f8f7f..ab05513 100644 --- a/test-suite/tests/srfi-18.test +++ b/test-suite/tests/srfi-18.test @@ -96,6 +96,12 @@ (let ((old-secs (car (current-time)))) (unspecified? (thread-sleep! (+ (time->seconds (current-time))))))) + (pass-if "thread sleeps fractions of a second" + (let* ((current (time->seconds (current-time))) + (future (+ current 0.5))) + (thread-sleep! future) + (>= (time->seconds (current-time)) future))) + (pass-if "thread does not sleep on past time" (let ((past-time (seconds->time (- (time->seconds (current-time)) 2)))) (unspecified? (thread-sleep! past-time))))) @@ -479,4 +485,4 @@ (eq? (uncaught-exception-reason obj) 'foo) (set! success #t))) (lambda () (thread-join! t))) - success))))) \ No newline at end of file + success))))) hooks/post-receive -- GNU Guile
