source: project/release/5/mailbox/trunk/tests/mailbox-primordial-test.scm @ 36192

Last change on this file since 36192 was 36192, checked in by Kon Lovett, 2 years ago

C5 port

File size: 858 bytes
Line 
1;
2(import (chicken condition))
3
4(define (maybe-condition->list exn)
5  (or
6    (and (condition? exn) (condition->list exn))
7    exn) )
8
9;from caolan
10
11(print)
12(print "** Test Primordial Waiting **")
13
14(import srfi-18 mailbox)
15
16(define mbox (make-mailbox))
17
18(define primordial ##sys#primordial-thread #;(current-thread))
19
20(define (tst-thd)
21  (thread-sleep! 1)
22  (thread-signal! primordial 'example) )
23
24(define tst-thd-1 (thread-start! tst-thd))
25
26#; ;; this hangs forever and eats all my cycles (with timeout)
27(handle-exceptions exn
28  (print "+ wait with timeout NOT OK for primordial thread: " (maybe-condition->list exn))
29  (mailbox-receive! mbox 4) )
30
31;; this exits as expected with the 'example exception (no timeout)
32(handle-exceptions exn
33  (print "+ wait with no timeout OK for primordial thread: " (maybe-condition->list exn))
34  (mailbox-receive! mbox) )
Note: See TracBrowser for help on using the repository browser.