From 82d0dd13f2020bfcb8f28e525f6d6dea06b69d81 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Mon, 11 Feb 2008 14:20:54 +0000 Subject: [PATCH] handle #f for sleep svn: r8619 --- collects/scheme/sandbox.ss | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/collects/scheme/sandbox.ss b/collects/scheme/sandbox.ss index cb93fe6c5e..4a54897559 100644 --- a/collects/scheme/sandbox.ss +++ b/collects/scheme/sandbox.ss @@ -215,16 +215,17 @@ (lambda () (define this (current-thread)) (define timer - (thread (lambda () - (sleep sec) - ;; even in this case there are no parameters - ;; to copy, since it is on a different thread - (set! r (cons #f 'time)) - (kill-thread this)))) + (and sec + (thread (lambda () + (sleep sec) + ;; even in this case there are no parameters + ;; to copy, since it is on a different thread + (set! r (cons #f 'time)) + (kill-thread this))))) (set! r (with-handlers ([void (lambda (e) (list (p) raise e))]) (call-with-values thunk (lambda vs (list* (p) values vs))))) - (kill-thread timer)))) + (when timer (kill-thread timer))))) (custodian-shutdown-all c) (unless r (error 'call-with-limits "internal error")) ;; apply parameter changes first