Changeset 10 in project for futures/futures-base.scm


Ignore:
Timestamp:
11/07/05 06:48:20 (16 years ago)
Author:
felix winkelmann
Message:

more eggs, some fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • futures/futures-base.scm

    r3 r10  
    55(declare
    66  (fixnum)
    7   (export future:make-future future? force) )
     7  (export future:make-future future? force future-condition future-failed? future-complete? future-thread) )
    88
    9 (define-record future results exn failed? %complete? thread)
     9(define-record future results condition failed? complete? thread)
    1010
    1111(define (future:make-future thunk)
     
    1515               (handle-exceptions ex
    1616                   (begin
    17                      (future-exn-set! f ex)
     17                     (future-condition-set! f ex)
    1818                     (future-failed?-set! f #t) )
    1919                 (future-results-set! f (receive (thunk))) )
    20                (future-%complete?-set! f #t) ) ) ) )
     20               (future-complete?-set! f #t) ) ) ) )
    2121    (future-thread-set! f t)
    2222    (thread-start! t)
     
    2828      (if (future? f)
    2929          (let loop ()
    30             (cond ((future-failed? f) (raise (future-exn f)))
    31                   ((future-%complete? f) (apply values (future-results f)))
     30            (cond ((future-failed? f) (raise (future-condition f)))
     31                  ((future-complete? f) (apply values (future-results f)))
    3232                  (else
    3333                   (thread-join! (future-thread f))
Note: See TracChangeset for help on using the changeset viewer.