syscalls: Delay resolution of "scm_set_automatic_finalization_enabled".
* guix/build/syscalls.scm (%set-automatic-finalization-enabled?!) [guile-2.2]: Wrap in 'delay'.
This commit is contained in:
parent
2acfe022a7
commit
ef03d8dc37
|
@ -725,15 +725,19 @@ mounted at FILE."
|
||||||
(cond-expand
|
(cond-expand
|
||||||
(guile-2.2
|
(guile-2.2
|
||||||
(define %set-automatic-finalization-enabled?!
|
(define %set-automatic-finalization-enabled?!
|
||||||
(let ((proc (pointer->procedure int
|
;; When using a statically-linked Guile, for instance in the initrd, we
|
||||||
(dynamic-func
|
;; cannot resolve this symbol, but most of the time we don't need it
|
||||||
"scm_set_automatic_finalization_enabled"
|
;; anyway. Thus, delay it.
|
||||||
(dynamic-link))
|
(let ((proc (delay
|
||||||
(list int))))
|
(pointer->procedure int
|
||||||
|
(dynamic-func
|
||||||
|
"scm_set_automatic_finalization_enabled"
|
||||||
|
(dynamic-link))
|
||||||
|
(list int)))))
|
||||||
(lambda (enabled?)
|
(lambda (enabled?)
|
||||||
"Switch on or off automatic finalization in a separate thread.
|
"Switch on or off automatic finalization in a separate thread.
|
||||||
Turning finalization off shuts down the finalization thread as a side effect."
|
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)
|
(define-syntax-rule (without-automatic-finalization exp)
|
||||||
"Turn off automatic finalization within the dynamic extent of EXP."
|
"Turn off automatic finalization within the dynamic extent of EXP."
|
||||||
|
|
Loading…
Reference in New Issue