From e041f2d0a140f76165134ca67e2dca309b4a9222 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?=
Date: Thu, 21 Apr 2022 19:49:49 +0200
Subject: Move repl-start to end of main.
Since everything is properties the repl thread needs to be spawned AFTER
the configuration is loaded.
---
module/calp/main.scm | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/module/calp/main.scm b/module/calp/main.scm
index 8efaf5ae..1cbd0f4e 100644
--- a/module/calp/main.scm
+++ b/module/calp/main.scm
@@ -127,10 +127,6 @@ the same code as ical.
")
(when stprof (statprof-start))
- (cond [(eqv? #t repl) (repl-start (format #f "~a/calp-~a"
- (xdg-runtime-dir)
- (getpid)))]
- [repl => repl-start])
;; Load config
@@ -192,6 +188,12 @@ the same code as ical.")
(when (file-exists? z)
(primitive-load z)))
+ ;; Start repl late, since configuration items are implemented as properties,
+ ;; meaning that they are thread local (and the repl lives in its own thread).
+ (cond [(eqv? #t repl) (repl-start (format #f "~a/calp-~a"
+ (xdg-runtime-dir)
+ (getpid)))]
+ [repl => repl-start])
(let ((ropt (ornull (option-ref opts '() '())
'("term"))))
--
cgit v1.2.3