From 93c98135461e3a415cbfdb894a619519537a1cf7 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 4 Oct 2020 13:22:35 +0100 Subject: [PATCH] Fix the implementation of par-map& It was pretty wrong... --- guix-data-service/utils.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/guix-data-service/utils.scm b/guix-data-service/utils.scm index c50cb64..cc9b7ac 100644 --- a/guix-data-service/utils.scm +++ b/guix-data-service/utils.scm @@ -133,9 +133,11 @@ (let loop ((lists lists)) (match lists (((heads tails ...) ...) - (let ((tail (defer-to-thread-pool-channel (loop tails))) - (head (apply proc heads))) - (cons head (fetch-result-of-defered-thunk tail)))) + (let ((tail (loop tails)) + (head (defer-to-thread-pool-channel + (lambda () + (apply proc heads))))) + (cons (fetch-result-of-defered-thunk head) tail))) (_ '())))))