guix-commits
[Top][All Lists]
Advanced

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

03/03: syscalls: Delay resolution of "scm_set_automatic_finalization_ena


From: Ludovic Courtès
Subject: 03/03: syscalls: Delay resolution of "scm_set_automatic_finalization_enabled".
Date: Tue, 18 Jul 2017 09:31:19 -0400 (EDT)

civodul pushed a commit to branch core-updates
in repository guix.

commit ef03d8dc3724caf59c7ea4a551084ddc601e4597
Author: Ludovic Courtès <address@hidden>
Date:   Tue Jul 18 15:29:45 2017 +0200

    syscalls: Delay resolution of "scm_set_automatic_finalization_enabled".
    
    * guix/build/syscalls.scm (%set-automatic-finalization-enabled?!) 
[guile-2.2]:
    Wrap in 'delay'.
---
 guix/build/syscalls.scm | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index 549612f..41208e3 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -725,15 +725,19 @@ mounted at FILE."
 (cond-expand
   (guile-2.2
    (define %set-automatic-finalization-enabled?!
-     (let ((proc (pointer->procedure int
-                                     (dynamic-func
-                                      "scm_set_automatic_finalization_enabled"
-                                      (dynamic-link))
-                                     (list int))))
+     ;; When using a statically-linked Guile, for instance in the initrd, we
+     ;; cannot resolve this symbol, but most of the time we don't need it
+     ;; anyway.  Thus, delay it.
+     (let ((proc (delay
+                   (pointer->procedure int
+                                       (dynamic-func
+                                        
"scm_set_automatic_finalization_enabled"
+                                        (dynamic-link))
+                                       (list int)))))
        (lambda (enabled?)
          "Switch on or off automatic finalization in a separate thread.
 Turning finalization off shuts down the finalization thread as a side effect."
-         (->bool (proc (if enabled? 1 0))))))
+         (->bool ((force proc) (if enabled? 1 0))))))
 
    (define-syntax-rule (without-automatic-finalization exp)
      "Turn off automatic finalization within the dynamic extent of EXP."



reply via email to

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