aboutsummaryrefslogtreecommitdiff
path: root/guix-build-coordinator
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-04-20 16:31:41 +0100
committerChristopher Baines <mail@cbaines.net>2023-04-20 16:31:41 +0100
commit1dfc122658d00d98dbd3a18ecda3502ce28cde41 (patch)
tree9bd8a9b1db94688e0688489d8dd414636f1f4916 /guix-build-coordinator
parent971ec98f35b0b5c18dc4816b370f25cf3d37c2fb (diff)
downloadbuild-coordinator-1dfc122658d00d98dbd3a18ecda3502ce28cde41.tar
build-coordinator-1dfc122658d00d98dbd3a18ecda3502ce28cde41.tar.gz
Use set-car! when sorting the prioritised work queue
As stable-sort! probably doesn't guarantee to alter the list as I was previously expecting.
Diffstat (limited to 'guix-build-coordinator')
-rw-r--r--guix-build-coordinator/utils.scm12
1 files changed, 7 insertions, 5 deletions
diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm
index 0d2e39d..6af9a0b 100644
--- a/guix-build-coordinator/utils.scm
+++ b/guix-build-coordinator/utils.scm
@@ -993,11 +993,13 @@ References: ~a~%"
(lambda* (args #:key priority)
(with-mutex queue-mutex
(enq! queue (cons priority args))
- (stable-sort! (car queue)
- (lambda (a b)
- (priority<?
- (car a)
- (car b))))
+ (set-car!
+ queue
+ (stable-sort! (car queue)
+ (lambda (a b)
+ (priority<?
+ (car a)
+ (car b)))))
(sync-q! queue)
(start-new-threads-if-necessary (get-thread-count))
(signal-condition-variable job-available)))