Welcome to the CHICKEN Scheme pasting service

thread-signal to thread waiting on mailbox-receive! timeout added by caolanm on Tue May 23 11:19:16 2017

(use srfi-18 mailbox)

(define mbox (make-mailbox))
(define primordial (current-thread))

(define t (thread-start! (lambda ()
                           (thread-sleep! 1)
                           (thread-signal! primordial 'example))))

;; this hangs forever and eats all my cycles (with timeout)
(print (mailbox-receive! mbox 4))

;; this exits as expected with the 'example exception (no timeout)
(print (mailbox-receive! mbox))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which egg implements a Scheme to JavaScript compiler?
Visually impaired? Let me spell it for you (wav file) download WAV