diff options
author | Christopher Baines <mail@cbaines.net> | 2023-04-20 16:31:41 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-04-20 16:31:41 +0100 |
commit | 1dfc122658d00d98dbd3a18ecda3502ce28cde41 (patch) | |
tree | 9bd8a9b1db94688e0688489d8dd414636f1f4916 /guix-build-coordinator | |
parent | 971ec98f35b0b5c18dc4816b370f25cf3d37c2fb (diff) | |
download | build-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.scm | 12 |
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))) |