Initial commit
This commit is contained in:
commit
2f39c58d6c
27 changed files with 2969 additions and 0 deletions
21
knots.scm
Normal file
21
knots.scm
Normal 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))))
|
Loading…
Add table
Add a link
Reference in a new issue