aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-09-07 15:16:25 +0100
committerChristopher Baines <mail@cbaines.net>2023-09-07 15:16:25 +0100
commit6f061356d52b614afa4337a33b248bcb071b0314 (patch)
tree136affa1f76f14b7c90734c53ca41b236cd888c3
parentafb6b8185d4142eaaa1fc46e0971155d71b324f9 (diff)
downloadnar-herder-6f061356d52b614afa4337a33b248bcb071b0314.tar
nar-herder-6f061356d52b614afa4337a33b248bcb071b0314.tar.gz
Set thread names for worker threads
-rw-r--r--nar-herder/utils.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/nar-herder/utils.scm b/nar-herder/utils.scm
index 292d308..68d218d 100644
--- a/nar-herder/utils.scm
+++ b/nar-herder/utils.scm
@@ -436,9 +436,17 @@ falling back to en_US.utf8\n"
(let ((channel (make-channel)))
(for-each
- (lambda _
+ (lambda (thread-index)
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name
+ (string-append
+ name " w t "
+ (number->string thread-index))))
+ (const #t))
+
(let init ((args (initializer/safe)))
(parameterize ((param args))
(let loop ((current-lifetime lifetime))