From fa6db19ff1b60ca3faab30e37787bbf9f486f5f0 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 20 Jun 2020 12:03:58 +0100 Subject: Make worker threads compatible with multiple return values --- guix-build-coordinator/utils.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index 22da21a..440b31b 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -91,7 +91,10 @@ arguments of the worker thread procedure." "worker-thread: exception: ~A\n" exn) (raise-exception exn)) (lambda () - (apply proc args)))) + (call-with-values + (lambda () + (apply proc args)) + (lambda vals vals))))) #:unwind? #t)))) (loop))))))) (iota parallelism)) @@ -109,7 +112,7 @@ If already in the worker thread, call PROC immediately." (('worker-thread-error . exn) (raise-exception exn)) (result - result)))))) + (apply values result))))))) (define (random-v4-uuid) ;; https://tools.ietf.org/html/rfc4122#page-14 -- cgit v1.2.3