From 7ed5ac833f95ff09300df8d8e22ba023cf74fef0 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 15 May 2008 17:29:49 +0000 Subject: [PATCH] doc clarifications (PR 9307) and arity issue (PR 9025) svn: r9855 original commit: 4effd7b8973373d6e6f280cb15bfd79c082ac066 --- collects/mzlib/thread.ss | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/collects/mzlib/thread.ss b/collects/mzlib/thread.ss index 2021da1..0dcf5c6 100644 --- a/collects/mzlib/thread.ss +++ b/collects/mzlib/thread.ss @@ -41,18 +41,13 @@ (lambda () (init) (loop)))) - (lambda new-state - (let ([num (length new-state)]) - (unless (procedure-arity-includes? f num) - (raise - (make-exn:fail:contract:arity - (format ": consumer procedure arity is ~e; provided ~s argument~a" - (procedure-arity f) num (if (= 1 num) "" "s")) - (current-continuation-marks))))) - (semaphore-wait protect) - (set! front-state (cons new-state front-state)) - (semaphore-post protect) - (semaphore-post sema))))) + (procedure-reduce-arity + (lambda new-state + (semaphore-wait protect) + (set! front-state (cons new-state front-state)) + (semaphore-post protect) + (semaphore-post sema)) + (procedure-arity f))))) (define/kw (run-server port-number handler connection-timeout #:optional