;from caolan (import (chicken condition)) (import (srfi 18)) (import mailbox) ;; (define (ensure-conditions-as-list exn) (or (and (condition? exn) (condition->list exn)) exn) ) ;; (print) (print "** Test Primordial Waiting **") ;; (define mbox (make-mailbox 'example)) (assert (eq? ##sys#primordial-thread (current-thread))) (define (test-thread) (thread-sleep! 1) (thread-signal! ##sys#primordial-thread 'example) ) (define test-thread-1 (thread-start! test-thread)) ;#; ;this hangs forever and eats all my cycles (with timeout) (handle-exceptions exn (print "+ wait with timeout NOT OK for primordial thread: " (ensure-conditions-as-list exn)) (mailbox-receive! mbox 4) ) ;this exits as expected with the 'example exception (no timeout) (handle-exceptions exn (print "+ wait without timeout OK for primordial thread: " (ensure-conditions-as-list exn)) (mailbox-receive! mbox) ) ;; (print "** Tested Primordial Waiting **") (thread-join! test-thread-1)