(import (srfi 18)) (define m (make-mutex)) (define c (make-condition-variable)) (define countdown 5) (define j (thread-start! (lambda () (let loop () (mutex-lock! m) (if (zero? countdown) (print "blastoff!") (begin (mutex-unlock! m c) (loop))))))) (do () ((zero? countdown)) (print "blastoff in " countdown "...") (thread-sleep! 1) (set! countdown (sub1 countdown)) (condition-variable-signal! c)) (thread-join! j)