guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Switch to guile-fibers@1.1


From: Christopher Baines
Subject: branch master updated: Switch to guile-fibers@1.1
Date: Wed, 09 Feb 2022 12:22:03 -0500

This is an automated email from the git hooks/post-receive script.

cbaines pushed a commit to branch master
in repository data-service.

The following commit(s) were added to refs/heads/master by this push:
     new 4a1088c  Switch to guile-fibers@1.1
4a1088c is described below

commit 4a1088c21687531de0b4e062e1bf9ec491e5d4da
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Wed Feb 9 17:20:54 2022 +0000

    Switch to guile-fibers@1.1
    
    I think the main change required is just to stop accessing the now missing
    current-fiber parameter.
---
 guix-data-service/utils.scm | 65 ++++++++++++++++++++++-----------------------
 guix-dev.scm                |  2 +-
 2 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/guix-data-service/utils.scm b/guix-data-service/utils.scm
index 0250e42..ed13ef4 100644
--- a/guix-data-service/utils.scm
+++ b/guix-data-service/utils.scm
@@ -54,39 +54,38 @@
 
 
 (define* (make-thread-pool-channel #:key (threads 8))
-  (parameterize (((@@ (fibers internal) current-fiber) #f))
-    (let ((channel (make-channel)))
-      (for-each
-       (lambda _
-         (call-with-new-thread
-          (lambda ()
-            (let loop ()
-              (match (get-message channel)
-                (((? channel? reply) . (? procedure? proc))
-                 (put-message
-                  reply
-                  (with-exception-handler
-                      (lambda (exn)
-                        (cons 'worker-thread-error exn))
-                    (lambda ()
-                      (with-exception-handler
-                          (lambda (exn)
-                            (simple-format
-                             (current-error-port)
-                             "worker thread: exception: ~A\n"
-                             exn)
-                            (backtrace)
-                            (raise-exception exn))
-                        (lambda ()
-                          (call-with-values
-                              proc
-                            (lambda vals
-                              vals)))))
-                    #:unwind? #t))
-                 (loop))
-                (_ #f))))))
-       (iota threads))
-      channel)))
+  (let ((channel (make-channel)))
+    (for-each
+     (lambda _
+       (call-with-new-thread
+        (lambda ()
+          (let loop ()
+            (match (get-message channel)
+              (((? channel? reply) . (? procedure? proc))
+               (put-message
+                reply
+                (with-exception-handler
+                    (lambda (exn)
+                      (cons 'worker-thread-error exn))
+                  (lambda ()
+                    (with-exception-handler
+                        (lambda (exn)
+                          (simple-format
+                           (current-error-port)
+                           "worker thread: exception: ~A\n"
+                           exn)
+                          (backtrace)
+                          (raise-exception exn))
+                      (lambda ()
+                        (call-with-values
+                            proc
+                          (lambda vals
+                            vals)))))
+                  #:unwind? #t))
+               (loop))
+              (_ #f))))))
+     (iota threads))
+    channel))
 
 (define %thread-pool-mutex (make-mutex))
 (define %thread-pool-channel #f)
diff --git a/guix-dev.scm b/guix-dev.scm
index 436140d..394b873 100644
--- a/guix-dev.scm
+++ b/guix-dev.scm
@@ -51,7 +51,7 @@
      ("guile-email" ,guile-email)
      ("guile-json" ,guile-json-4)
      ("guile-squee" ,guile-squee)
-     ("guile-fibers" ,guile-fibers)
+     ("guile-fibers" ,guile-fibers-1.1)
      ("guile-gcrypt" ,guile-gcrypt)
      ("guile-lzlib" ,guile-lzlib)
      ("guile-readline" ,guile-readline)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]