Initial commit

This commit is contained in:
Christopher Baines 2024-11-19 18:43:43 +00:00
commit 2f39c58d6c
27 changed files with 2969 additions and 0 deletions

21
knots.scm Normal file
View file

@ -0,0 +1,21 @@
(define-module (knots)
#:use-module (ice-9 suspendable-ports)
#:export (call-with-default-io-waiters
wait-when-system-clock-behind))
(define (call-with-default-io-waiters thunk)
(parameterize
((current-read-waiter (@@ (ice-9 suspendable-ports)
default-read-waiter))
(current-write-waiter (@@ (ice-9 suspendable-ports)
default-write-waiter)))
(thunk)))
(define (wait-when-system-clock-behind)
(let ((start-of-the-year-2000 946684800))
(while (< (current-time)
start-of-the-year-2000)
(simple-format (current-error-port)
"warning: system clock potentially behind, waiting\n")
(sleep 20))))