(use mailbox-threads) (define (t1-thunk) (let ((msg (thread-receive 999))) (if (equal? msg 'quit) (begin (print "Bye Ma!") (thread-terminate! (current-thread))) (begin (print msg) (t1-thunk))))) (define t1 (make-thread t1-thunk 't1)) (thread-send t1 "Hi there!") (thread-start! t1) (thread-send t1 "still awake!") (thread-send t1 "Look Ma! Threads with mailboxes!") (thread-start! (lambda () (thread-send t1 "hi from two"))) (print (thread-specific t1)) (thread-specific-set! t1 "hi") (print (thread-specific t1)) (thread-send t1 'quit) (thread-sleep! 2) (thread-send (current-thread) "hehe") (print "got message " (thread-receive 2)) (exit 0)