Destroy the utility thread pool

This commit is contained in:
Christopher Baines 2025-07-08 07:25:02 +01:00
parent 401f916517
commit f279aa0071

View file

@ -2853,16 +2853,17 @@ WHERE builder != 'builtin:download'
extra-inferior-environment-variables extra-inferior-environment-variables
ignore-systems ignore-targets ignore-systems ignore-targets
inferior-memory-limit) inferior-memory-limit)
(define utility-thread-pool
(make-fixed-size-thread-pool parallelism))
(define call-with-utility-thread (define call-with-utility-thread
(let* ((thread-pool (let ((queued-channel
(make-fixed-size-thread-pool parallelism)) ;; There might be high demand for this, so order the requests
(queued-channel ;; TODO This doesn't shut down
;; There might be high demand for this, so order the requests (spawn-queueing-fiber
(spawn-queueing-fiber (fixed-size-thread-pool-channel utility-thread-pool))))
(fixed-size-thread-pool-channel thread-pool))))
(lambda (thunk) (lambda (thunk)
(call-with-thread (call-with-thread
thread-pool utility-thread-pool
thunk thunk
#:channel queued-channel)))) #:channel queued-channel))))
@ -2965,6 +2966,8 @@ WHERE builder != 'builtin:download'
(fibers-force guix-revision-id-promise))) (fibers-force guix-revision-id-promise)))
(destroy-parallelism-limiter (destroy-parallelism-limiter
read-derivations/parallelism-limiter) read-derivations/parallelism-limiter)
(destroy-thread-pool
utility-thread-pool)
(and (and
(if (defined? 'channel-news-for-commit (if (defined? 'channel-news-for-commit