Changeset 35501 in project


Ignore:
Timestamp:
04/30/18 16:03:28 (4 weeks ago)
Author:
kooda
Message:

Update CHICKEN 5's srfi-18 egg

Location:
release/5/srfi-18
Files:
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • release/5/srfi-18/tags/1.4/srfi-18.egg

    r34686 r35501  
    11;; -*- scheme -*-
    2 ((synopsis "SRFI-18 thread library")
     2((version "1.4")
     3 (synopsis "SRFI-18 thread library")
    34 (author "The CHICKEN Team")
    45 (maintainer "The CHICKEN Team")
     
    67 (license "BSD")
    78 (test-dependencies compile-file)
    8  (components (extension srfi-18 #;(types-file))))
     9 (components (extension srfi-18 (types-file (predefined)))))
  • release/5/srfi-18/tags/1.4/srfi-18.scm

    r34686 r35501  
    3030 (usual-integrations)
    3131 (disable-interrupts))
    32 
    33 (register-feature! 'srfi-18)
    3432
    3533
     
    8078
    8179(import (scheme)
    82         (chicken)
     80        (chicken base)
     81        (chicken fixnum)
    8382        (chicken flonum)
    8483        (chicken condition)
     84        (chicken platform)
    8585        (chicken time))
     86
     87(register-feature! 'srfi-18)
    8688
    8789(define-syntax dbg
     
    111113
    112114(define (current-time)
    113   (##sys#make-structure 'time (current-milliseconds)))
     115  (##sys#make-structure 'time (exact->inexact (current-milliseconds))))
    114116
    115117(define (time->seconds tm)
  • release/5/srfi-18/tags/1.4/srfi-18.types

    r31403 r35501  
    11
    2 (abandoned-mutex-exception? (#(procedure #:pure) abandoned-mutex-exception? (*) boolean))
    3 (condition-variable-broadcast! (#(procedure #:clean #:enforce) condition-variable-broadcast! ((struct condition-variable)) undefined))
    4 (condition-variable-name (#(procedure #:clean #:enforce) condition-variable-name ((struct condition-variable)) *))
    5 (condition-variable-signal! (#(procedure #:clean #:enforce) condition-variable-signal! ((struct condition-variable)) undefined))
    6 (condition-variable-specific (#(procedure #:clean #:enforce) condition-variable-specific ((struct condition-variable)) *))
    7 (condition-variable-specific-set! (#(procedure #:clean #:enforce) condition-variable-specific-set! ((struct condition-variable) *) undefined))
     2(srfi-18#abandoned-mutex-exception? (#(procedure #:pure) abandoned-mutex-exception? (*) boolean))
     3(srfi-18#condition-variable-broadcast! (#(procedure #:clean #:enforce) srfi-18#condition-variable-broadcast! ((struct condition-variable)) undefined))
     4(srfi-18#condition-variable-name (#(procedure #:clean #:enforce) srfi-18#condition-variable-name ((struct condition-variable)) *))
     5(srfi-18#condition-variable-signal! (#(procedure #:clean #:enforce) srfi-18#condition-variable-signal! ((struct condition-variable)) undefined))
     6(srfi-18#condition-variable-specific (#(procedure #:clean #:enforce) srfi-18#condition-variable-specific ((struct condition-variable)) *))
     7(srfi-18#condition-variable-specific-set! (#(procedure #:clean #:enforce) srfi-18#condition-variable-specific-set! ((struct condition-variable) *) undefined))
    88
    9 (condition-variable? (#(procedure #:pure #:predicate (struct condition-variable))
    10                       condition-variable? (*)
     9(srfi-18#condition-variable? (#(procedure #:pure #:predicate (struct condition-variable))
     10                      srfi-18#condition-variable? (*)
    1111                      boolean))
    1212
    13 (current-thread (#(procedure #:clean) current-thread () (struct thread))) ;XXX
     13(srfi-18#current-thread (#(procedure #:clean) srfi-18#current-thread () (struct thread))) ;XXX
    1414
    15 (current-time (#(procedure #:clean) current-time () (struct time)))
    16 (join-timeout-exception? (#(procedure #:pure) join-timeout-exception? (*) boolean))
    17 (make-condition-variable (#(procedure #:clean) make-condition-variable (#!optional *) (struct condition-variable)))
    18 (make-mutex (#(procedure #:clean) make-mutex (#!optional *) (struct mutex)))
    19 (make-thread (#(procedure #:clean #:enforce) make-thread ((procedure () . *) #!optional *) (struct thread)))
    20 (mutex-lock! (#(procedure #:clean #:enforce) mutex-lock! ((struct mutex) #!optional (or false number (struct time)) (or false (struct thread))) boolean))
     15(srfi-18#current-time (#(procedure #:clean) srfi-18#current-time () (struct time)))
     16(srfi-18#join-timeout-exception? (#(procedure #:pure) srfi-18#join-timeout-exception? (*) boolean))
     17(srfi-18#make-condition-variable (#(procedure #:clean) srfi-18#make-condition-variable (#!optional *) (struct condition-variable)))
     18(srfi-18#make-mutex (#(procedure #:clean) srfi-18#make-mutex (#!optional *) (struct mutex)))
     19(srfi-18#make-thread (#(procedure #:clean #:enforce) srfi-18#make-thread ((procedure () . *) #!optional *) (struct thread)))
     20(srfi-18#mutex-lock! (#(procedure #:clean #:enforce) srfi-18#mutex-lock! ((struct mutex) #!optional (or false number (struct time)) (or false (struct thread))) boolean))
    2121
    22 (mutex-name (#(procedure #:clean #:enforce) mutex-name ((struct mutex)) *)
     22(srfi-18#mutex-name (#(procedure #:clean #:enforce) srfi-18#mutex-name ((struct mutex)) *)
    2323            (((struct mutex)) (##sys#slot #(1) '1)))
    2424
    25 (mutex-specific (#(procedure #:clean #:enforce) mutex-specific ((struct mutex)) *)
     25(srfi-18#mutex-specific (#(procedure #:clean #:enforce) srfi-18#mutex-specific ((struct mutex)) *)
    2626                (((struct mutex)) (##sys#slot #(1) '6)))
    2727
    28 (mutex-specific-set! (#(procedure #:clean #:enforce) mutex-specific-set! ((struct mutex) *) undefined)
     28(srfi-18#mutex-specific-set! (#(procedure #:clean #:enforce) srfi-18#mutex-specific-set! ((struct mutex) *) undefined)
    2929                     (((struct mutex) *) (##sys#setslot #(1) '6 #(2))))
    3030
    31 (mutex-state (#(procedure #:clean #:enforce) mutex-state ((struct mutex)) (or symbol (struct thread))))
    32 (mutex-unlock! (#(procedure #:clean #:enforce) mutex-unlock! ((struct mutex) #!optional (struct condition-variable) *) undefined))
     31(srfi-18#mutex-state (#(procedure #:clean #:enforce) srfi-18#mutex-state ((struct mutex)) (or symbol (struct thread))))
     32(srfi-18#mutex-unlock! (#(procedure #:clean #:enforce) srfi-18#mutex-unlock! ((struct mutex) #!optional (struct condition-variable) *) undefined))
    3333
    34 (mutex? (#(procedure #:pure #:predicate (struct mutex)) mutex? (*) boolean))
     34(srfi-18#mutex? (#(procedure #:pure #:predicate (struct mutex)) srfi-18#mutex? (*) boolean))
    3535
    36 (raise (procedure raise (*) noreturn))
    37 (seconds->time (#(procedure #:clean #:enforce) seconds->time (number) (struct time)))
    38 (terminated-thread-exception? (#(procedure #:pure) terminated-thread-exception? (*) boolean))
    39 (thread-join! (#(procedure #:clean #:enforce) thread-join! ((struct thread) #!optional * *) . *))
     36(srfi-18#raise (procedure srfi-18#raise (*) noreturn))
     37(srfi-18#seconds->time (#(procedure #:clean #:enforce) srfi-18#seconds->time (number) (struct time)))
     38(srfi-18#terminated-thread-exception? (#(procedure #:pure) srfi-18#terminated-thread-exception? (*) boolean))
     39(srfi-18#thread-join! (#(procedure #:clean #:enforce) srfi-18#thread-join! ((struct thread) #!optional * *) . *))
    4040
    41 (thread-name (#(procedure #:clean #:enforce) thread-name ((struct thread)) *)
     41(srfi-18#thread-name (#(procedure #:clean #:enforce) srfi-18#thread-name ((struct thread)) *)
    4242             (((struct thread)) (##sys#slot #(1) '6)))
    4343
    44 (thread-quantum (#(procedure #:clean #:enforce) thread-quantum ((struct thread)) fixnum)
     44(srfi-18#thread-quantum (#(procedure #:clean #:enforce) srfi-18#thread-quantum ((struct thread)) fixnum)
    4545                (((struct thread)) (##sys#slot #(1) '9)))
    4646
    47 (thread-quantum-set! (#(procedure #:clean #:enforce) thread-quantum-set! ((struct thread) fixnum) undefined))
    48 (thread-resume! (#(procedure #:clean #:enforce) thread-resume! ((struct thread)) undefined))
    49 (thread-signal! (#(procedure #:clean #:enforce) thread-signal! ((struct thread) *) undefined))
    50 (thread-sleep! (#(procedure #:clean) thread-sleep! (*) undefined))
     47(srfi-18#thread-quantum-set! (#(procedure #:clean #:enforce) srfi-18#thread-quantum-set! ((struct thread) fixnum) undefined))
     48(srfi-18#thread-resume! (#(procedure #:clean #:enforce) srfi-18#thread-resume! ((struct thread)) undefined))
     49(srfi-18#thread-signal! (#(procedure #:clean #:enforce) srfi-18#thread-signal! ((struct thread) *) undefined))
     50(srfi-18#thread-sleep! (#(procedure #:clean) srfi-18#thread-sleep! (*) undefined))
    5151
    52 (thread-specific (#(procedure #:clean #:enforce) thread-specific ((struct thread)) *)
     52(srfi-18#thread-specific (#(procedure #:clean #:enforce) srfi-18#thread-specific ((struct thread)) *)
    5353                 (((struct thread)) (##sys#slot #(1) '10)))
    5454
    55 (thread-specific-set! (#(procedure #:clean #:enforce) thread-specific-set! ((struct thread) *) undefined)
     55(srfi-18#thread-specific-set! (#(procedure #:clean #:enforce) srfi-18#thread-specific-set! ((struct thread) *) undefined)
    5656                      (((struct thread) *) (##sys#setslot #(1) '10 #(2))))
    5757
    58 (thread-start! (#(procedure #:enforce) thread-start! ((or (struct thread) (procedure () . *))) (struct thread)))
     58(srfi-18#thread-start! (#(procedure #:enforce) srfi-18#thread-start! ((or (struct thread) (procedure () . *))) (struct thread)))
    5959
    60 (thread-state (#(procedure #:clean #:enforce) thread-state ((struct thread)) symbol)
     60(srfi-18#thread-state (#(procedure #:clean #:enforce) srfi-18#thread-state ((struct thread)) symbol)
    6161              (((struct thread)) (##sys#slot #(1) '3)))
    6262
    63 (thread-suspend! (#(procedure #:clean #:enforce) thread-suspend! ((struct thread)) undefined))
    64 (thread-terminate! (#(procedure #:clean #:enforce) thread-terminate! ((struct thread)) undefined))
    65 (thread-wait-for-i/o! (#(procedure #:clean #:enforce) thread-wait-for-i/o! (fixnum #!optional symbol) undefined))
    66 (thread-yield! (#(procedure #:clean) thread-yield! () undefined))
     63(srfi-18#thread-suspend! (#(procedure #:clean #:enforce) srfi-18#thread-suspend! ((struct thread)) undefined))
     64(srfi-18#thread-terminate! (#(procedure #:clean #:enforce) srfi-18#thread-terminate! ((struct thread)) undefined))
     65(srfi-18#thread-wait-for-i/o! (#(procedure #:clean #:enforce) srfi-18#thread-wait-for-i/o! (fixnum #!optional symbol) undefined))
     66(srfi-18#thread-yield! (#(procedure #:clean) srfi-18#thread-yield! () undefined))
    6767
    68 (thread? (#(procedure #:pure #:predicate (struct thread)) thread? (*) boolean))
     68(srfi-18#thread? (#(procedure #:pure #:predicate (struct thread)) srfi-18#thread? (*) boolean))
    6969
    70 (time->seconds (#(procedure #:clean #:enforce) time->seconds ((struct time)) number))
     70(srfi-18#time->seconds (#(procedure #:clean #:enforce) srfi-18#time->seconds ((struct time)) number))
    7171
    72 (time? (#(procedure #:pure #:predicate (struct time)) time? (*) boolean))
     72(srfi-18#time? (#(procedure #:pure #:predicate (struct time)) srfi-18#time? (*) boolean))
    7373
    74 (uncaught-exception-reason (#(procedure #:clean #:enforce) uncaught-exception-reason ((struct condition)) *))
    75 (uncaught-exception? (#(procedure #:pure) uncaught-exception? (*) boolean))
     74(srfi-18#uncaught-exception-reason (#(procedure #:clean #:enforce) srfi-18#uncaught-exception-reason ((struct condition)) *))
     75(srfi-18#uncaught-exception? (#(procedure #:pure) srfi-18#uncaught-exception? (*) boolean))
  • release/5/srfi-18/tags/1.4/tests/mutex-test.scm

    r34718 r35501  
    11;;;; mutex-test.scm
    22
    3 (import (chicken format) (chicken time) srfi-18)
     3(import chicken.format chicken.time srfi-18)
     4
     5(print "mutex-test.scm")
    46
    57(define test-has-failed #f)
     
    188190(thread-sleep! 3)
    189191;(tprint 'exit)
    190 
    191 (if test-has-failed (exit 1) (exit 0))
  • release/5/srfi-18/tags/1.4/tests/run.scm

    r34718 r35501  
    44(load "mutex-test.scm")
    55
     6(print "and on...")
     7
    68(compile-file "srfi-18-signal-test.scm")
    79(compile-file "signal-tests.scm")
  • release/5/srfi-18/tags/1.4/tests/signal-tests.scm

    r34718 r35501  
    11;;;; signal-tests.scm
    22
     3(module signal-tests ()
     4
     5  (import scheme
     6          (only chicken flush-output select)
     7          (chicken base)
     8          (chicken foreign)
     9          (chicken format)
     10          (chicken random)
     11          (chicken process)
     12          (chicken process signal)
     13          (chicken process-context)
     14          srfi-18)
     15
     16(print "signal-tests.scm")
    317
    418#+mingw32
     
    721  (exit))
    822
    9 
    10 (import srfi-18
    11         (chicken random) (chicken format)
    12         (chicken process-context)
    13         (chicken process) (chicken process signal))
    1423
    1524(define all-go? (make-parameter #f))
     
    5867    (tick #\.)))
    5968
     69(define posix-sleep (foreign-lambda unsigned-int "sleep" unsigned-int))
     70
    6071(let ((pid (process-fork child))
    6172      (sent1 0)
    6273      (sent2 0))
    6374  (print "Sleeping until child wakes us up") ; signal *should* interrupt the sleep
    64   (print "would have slept for " (sleep 5) " more seconds")
     75  (print "would have slept for " (posix-sleep 5) " more seconds")
    6576  (cond ((all-go?)
    6677         (print "sending signals to " pid)
    6778         (do ((i 1000 (sub1 i)))
    6879             ((zero? i))
    69            (thread-sleep! (/ (random 10) 1000))
    70            (do ((j (random 4) (sub1 j)))
     80           (thread-sleep! (/ (pseudo-random-integer 10) 1000))
     81           (do ((j (pseudo-random-integer 4) (sub1 j)))
    7182               ((zero? j))
    72              (case (random 2)
     83             (case (pseudo-random-integer 2)
    7384               ((0)
    7485                (tick #\A)
     
    8596         (process-signal pid signal/term)
    8697         (unless (all-go?) ; There's a bit of a race condition here, but that's okay
    87            (print "Would've slept for " (sleep 5) " more seconds"))
     98           (print "Would've slept for " (posix-sleep 5) " more seconds"))
    8899         (cond ((all-go?)
    89100                (print "Everything is ok!")
     
    97108              (print "terminating child process ...")
    98109              (exit 1))))
     110
     111)
  • release/5/srfi-18/tags/1.4/tests/simple-thread-test.scm

    r34718 r35501  
    22
    33
    4 (import (chicken random) srfi-18)
     4(import chicken.random srfi-18)
    55
    66
     
    99      ((>= i 10))
    1010    (print (current-thread) " sleeps ...")
    11     (thread-sleep! (random 3)))
     11    (thread-sleep! (pseudo-random-integer 3)))
    1212  (print (current-thread) " finished."))
    1313
     14(print "simple-thread-test.scm")
    1415(thread-start! spin)
    1516(thread-start! spin)
  • release/5/srfi-18/tags/1.4/tests/srfi-18-signal-test.scm

    r34718 r35501  
     1(print "srfi-18-signal-test.scm")
     2 
    13#+mingw32
    24(begin
     
    46  (exit))
    57
    6 (import posix srfi-18)
     8(import (chicken process signal) (chicken foreign) srfi-18)
    79
    810(define done #f)
  • release/5/srfi-18/trunk/srfi-18.egg

    r34686 r35501  
    11;; -*- scheme -*-
    2 ((synopsis "SRFI-18 thread library")
     2((version "1.5")
     3 (synopsis "SRFI-18 thread library")
    34 (author "The CHICKEN Team")
    45 (maintainer "The CHICKEN Team")
     
    67 (license "BSD")
    78 (test-dependencies compile-file)
    8  (components (extension srfi-18 #;(types-file))))
     9 (components (extension srfi-18 (types-file (predefined)))))
  • release/5/srfi-18/trunk/srfi-18.scm

    r34686 r35501  
    3030 (usual-integrations)
    3131 (disable-interrupts))
    32 
    33 (register-feature! 'srfi-18)
    3432
    3533
     
    8078
    8179(import (scheme)
    82         (chicken)
     80        (chicken base)
     81        (chicken fixnum)
    8382        (chicken flonum)
    8483        (chicken condition)
     84        (chicken platform)
    8585        (chicken time))
     86
     87(register-feature! 'srfi-18)
    8688
    8789(define-syntax dbg
     
    111113
    112114(define (current-time)
    113   (##sys#make-structure 'time (current-milliseconds)))
     115  (##sys#make-structure 'time (exact->inexact (current-milliseconds))))
    114116
    115117(define (time->seconds tm)
  • release/5/srfi-18/trunk/srfi-18.types

    r31403 r35501  
    11
    2 (abandoned-mutex-exception? (#(procedure #:pure) abandoned-mutex-exception? (*) boolean))
    3 (condition-variable-broadcast! (#(procedure #:clean #:enforce) condition-variable-broadcast! ((struct condition-variable)) undefined))
    4 (condition-variable-name (#(procedure #:clean #:enforce) condition-variable-name ((struct condition-variable)) *))
    5 (condition-variable-signal! (#(procedure #:clean #:enforce) condition-variable-signal! ((struct condition-variable)) undefined))
    6 (condition-variable-specific (#(procedure #:clean #:enforce) condition-variable-specific ((struct condition-variable)) *))
    7 (condition-variable-specific-set! (#(procedure #:clean #:enforce) condition-variable-specific-set! ((struct condition-variable) *) undefined))
     2(srfi-18#abandoned-mutex-exception? (#(procedure #:pure) abandoned-mutex-exception? (*) boolean))
     3(srfi-18#condition-variable-broadcast! (#(procedure #:clean #:enforce) srfi-18#condition-variable-broadcast! ((struct condition-variable)) undefined))
     4(srfi-18#condition-variable-name (#(procedure #:clean #:enforce) srfi-18#condition-variable-name ((struct condition-variable)) *))
     5(srfi-18#condition-variable-signal! (#(procedure #:clean #:enforce) srfi-18#condition-variable-signal! ((struct condition-variable)) undefined))
     6(srfi-18#condition-variable-specific (#(procedure #:clean #:enforce) srfi-18#condition-variable-specific ((struct condition-variable)) *))
     7(srfi-18#condition-variable-specific-set! (#(procedure #:clean #:enforce) srfi-18#condition-variable-specific-set! ((struct condition-variable) *) undefined))
    88
    9 (condition-variable? (#(procedure #:pure #:predicate (struct condition-variable))
    10                       condition-variable? (*)
     9(srfi-18#condition-variable? (#(procedure #:pure #:predicate (struct condition-variable))
     10                      srfi-18#condition-variable? (*)
    1111                      boolean))
    1212
    13 (current-thread (#(procedure #:clean) current-thread () (struct thread))) ;XXX
     13(srfi-18#current-thread (#(procedure #:clean) srfi-18#current-thread () (struct thread))) ;XXX
    1414
    15 (current-time (#(procedure #:clean) current-time () (struct time)))
    16 (join-timeout-exception? (#(procedure #:pure) join-timeout-exception? (*) boolean))
    17 (make-condition-variable (#(procedure #:clean) make-condition-variable (#!optional *) (struct condition-variable)))
    18 (make-mutex (#(procedure #:clean) make-mutex (#!optional *) (struct mutex)))
    19 (make-thread (#(procedure #:clean #:enforce) make-thread ((procedure () . *) #!optional *) (struct thread)))
    20 (mutex-lock! (#(procedure #:clean #:enforce) mutex-lock! ((struct mutex) #!optional (or false number (struct time)) (or false (struct thread))) boolean))
     15(srfi-18#current-time (#(procedure #:clean) srfi-18#current-time () (struct time)))
     16(srfi-18#join-timeout-exception? (#(procedure #:pure) srfi-18#join-timeout-exception? (*) boolean))
     17(srfi-18#make-condition-variable (#(procedure #:clean) srfi-18#make-condition-variable (#!optional *) (struct condition-variable)))
     18(srfi-18#make-mutex (#(procedure #:clean) srfi-18#make-mutex (#!optional *) (struct mutex)))
     19(srfi-18#make-thread (#(procedure #:clean #:enforce) srfi-18#make-thread ((procedure () . *) #!optional *) (struct thread)))
     20(srfi-18#mutex-lock! (#(procedure #:clean #:enforce) srfi-18#mutex-lock! ((struct mutex) #!optional (or false number (struct time)) (or false (struct thread))) boolean))
    2121
    22 (mutex-name (#(procedure #:clean #:enforce) mutex-name ((struct mutex)) *)
     22(srfi-18#mutex-name (#(procedure #:clean #:enforce) srfi-18#mutex-name ((struct mutex)) *)
    2323            (((struct mutex)) (##sys#slot #(1) '1)))
    2424
    25 (mutex-specific (#(procedure #:clean #:enforce) mutex-specific ((struct mutex)) *)
     25(srfi-18#mutex-specific (#(procedure #:clean #:enforce) srfi-18#mutex-specific ((struct mutex)) *)
    2626                (((struct mutex)) (##sys#slot #(1) '6)))
    2727
    28 (mutex-specific-set! (#(procedure #:clean #:enforce) mutex-specific-set! ((struct mutex) *) undefined)
     28(srfi-18#mutex-specific-set! (#(procedure #:clean #:enforce) srfi-18#mutex-specific-set! ((struct mutex) *) undefined)
    2929                     (((struct mutex) *) (##sys#setslot #(1) '6 #(2))))
    3030
    31 (mutex-state (#(procedure #:clean #:enforce) mutex-state ((struct mutex)) (or symbol (struct thread))))
    32 (mutex-unlock! (#(procedure #:clean #:enforce) mutex-unlock! ((struct mutex) #!optional (struct condition-variable) *) undefined))
     31(srfi-18#mutex-state (#(procedure #:clean #:enforce) srfi-18#mutex-state ((struct mutex)) (or symbol (struct thread))))
     32(srfi-18#mutex-unlock! (#(procedure #:clean #:enforce) srfi-18#mutex-unlock! ((struct mutex) #!optional (struct condition-variable) *) undefined))
    3333
    34 (mutex? (#(procedure #:pure #:predicate (struct mutex)) mutex? (*) boolean))
     34(srfi-18#mutex? (#(procedure #:pure #:predicate (struct mutex)) srfi-18#mutex? (*) boolean))
    3535
    36 (raise (procedure raise (*) noreturn))
    37 (seconds->time (#(procedure #:clean #:enforce) seconds->time (number) (struct time)))
    38 (terminated-thread-exception? (#(procedure #:pure) terminated-thread-exception? (*) boolean))
    39 (thread-join! (#(procedure #:clean #:enforce) thread-join! ((struct thread) #!optional * *) . *))
     36(srfi-18#raise (procedure srfi-18#raise (*) noreturn))
     37(srfi-18#seconds->time (#(procedure #:clean #:enforce) srfi-18#seconds->time (number) (struct time)))
     38(srfi-18#terminated-thread-exception? (#(procedure #:pure) srfi-18#terminated-thread-exception? (*) boolean))
     39(srfi-18#thread-join! (#(procedure #:clean #:enforce) srfi-18#thread-join! ((struct thread) #!optional * *) . *))
    4040
    41 (thread-name (#(procedure #:clean #:enforce) thread-name ((struct thread)) *)
     41(srfi-18#thread-name (#(procedure #:clean #:enforce) srfi-18#thread-name ((struct thread)) *)
    4242             (((struct thread)) (##sys#slot #(1) '6)))
    4343
    44 (thread-quantum (#(procedure #:clean #:enforce) thread-quantum ((struct thread)) fixnum)
     44(srfi-18#thread-quantum (#(procedure #:clean #:enforce) srfi-18#thread-quantum ((struct thread)) fixnum)
    4545                (((struct thread)) (##sys#slot #(1) '9)))
    4646
    47 (thread-quantum-set! (#(procedure #:clean #:enforce) thread-quantum-set! ((struct thread) fixnum) undefined))
    48 (thread-resume! (#(procedure #:clean #:enforce) thread-resume! ((struct thread)) undefined))
    49 (thread-signal! (#(procedure #:clean #:enforce) thread-signal! ((struct thread) *) undefined))
    50 (thread-sleep! (#(procedure #:clean) thread-sleep! (*) undefined))
     47(srfi-18#thread-quantum-set! (#(procedure #:clean #:enforce) srfi-18#thread-quantum-set! ((struct thread) fixnum) undefined))
     48(srfi-18#thread-resume! (#(procedure #:clean #:enforce) srfi-18#thread-resume! ((struct thread)) undefined))
     49(srfi-18#thread-signal! (#(procedure #:clean #:enforce) srfi-18#thread-signal! ((struct thread) *) undefined))
     50(srfi-18#thread-sleep! (#(procedure #:clean) srfi-18#thread-sleep! (*) undefined))
    5151
    52 (thread-specific (#(procedure #:clean #:enforce) thread-specific ((struct thread)) *)
     52(srfi-18#thread-specific (#(procedure #:clean #:enforce) srfi-18#thread-specific ((struct thread)) *)
    5353                 (((struct thread)) (##sys#slot #(1) '10)))
    5454
    55 (thread-specific-set! (#(procedure #:clean #:enforce) thread-specific-set! ((struct thread) *) undefined)
     55(srfi-18#thread-specific-set! (#(procedure #:clean #:enforce) srfi-18#thread-specific-set! ((struct thread) *) undefined)
    5656                      (((struct thread) *) (##sys#setslot #(1) '10 #(2))))
    5757
    58 (thread-start! (#(procedure #:enforce) thread-start! ((or (struct thread) (procedure () . *))) (struct thread)))
     58(srfi-18#thread-start! (#(procedure #:enforce) srfi-18#thread-start! ((or (struct thread) (procedure () . *))) (struct thread)))
    5959
    60 (thread-state (#(procedure #:clean #:enforce) thread-state ((struct thread)) symbol)
     60(srfi-18#thread-state (#(procedure #:clean #:enforce) srfi-18#thread-state ((struct thread)) symbol)
    6161              (((struct thread)) (##sys#slot #(1) '3)))
    6262
    63 (thread-suspend! (#(procedure #:clean #:enforce) thread-suspend! ((struct thread)) undefined))
    64 (thread-terminate! (#(procedure #:clean #:enforce) thread-terminate! ((struct thread)) undefined))
    65 (thread-wait-for-i/o! (#(procedure #:clean #:enforce) thread-wait-for-i/o! (fixnum #!optional symbol) undefined))
    66 (thread-yield! (#(procedure #:clean) thread-yield! () undefined))
     63(srfi-18#thread-suspend! (#(procedure #:clean #:enforce) srfi-18#thread-suspend! ((struct thread)) undefined))
     64(srfi-18#thread-terminate! (#(procedure #:clean #:enforce) srfi-18#thread-terminate! ((struct thread)) undefined))
     65(srfi-18#thread-wait-for-i/o! (#(procedure #:clean #:enforce) srfi-18#thread-wait-for-i/o! (fixnum #!optional symbol) undefined))
     66(srfi-18#thread-yield! (#(procedure #:clean) srfi-18#thread-yield! () undefined))
    6767
    68 (thread? (#(procedure #:pure #:predicate (struct thread)) thread? (*) boolean))
     68(srfi-18#thread? (#(procedure #:pure #:predicate (struct thread)) srfi-18#thread? (*) boolean))
    6969
    70 (time->seconds (#(procedure #:clean #:enforce) time->seconds ((struct time)) number))
     70(srfi-18#time->seconds (#(procedure #:clean #:enforce) srfi-18#time->seconds ((struct time)) number))
    7171
    72 (time? (#(procedure #:pure #:predicate (struct time)) time? (*) boolean))
     72(srfi-18#time? (#(procedure #:pure #:predicate (struct time)) srfi-18#time? (*) boolean))
    7373
    74 (uncaught-exception-reason (#(procedure #:clean #:enforce) uncaught-exception-reason ((struct condition)) *))
    75 (uncaught-exception? (#(procedure #:pure) uncaught-exception? (*) boolean))
     74(srfi-18#uncaught-exception-reason (#(procedure #:clean #:enforce) srfi-18#uncaught-exception-reason ((struct condition)) *))
     75(srfi-18#uncaught-exception? (#(procedure #:pure) srfi-18#uncaught-exception? (*) boolean))
  • release/5/srfi-18/trunk/tests/mutex-test.scm

    r34718 r35501  
    11;;;; mutex-test.scm
    22
    3 (import (chicken format) (chicken time) srfi-18)
     3(import chicken.format chicken.time srfi-18)
     4
     5(print "mutex-test.scm")
    46
    57(define test-has-failed #f)
     
    188190(thread-sleep! 3)
    189191;(tprint 'exit)
    190 
    191 (if test-has-failed (exit 1) (exit 0))
  • release/5/srfi-18/trunk/tests/run.scm

    r34718 r35501  
    44(load "mutex-test.scm")
    55
     6(print "and on...")
     7
    68(compile-file "srfi-18-signal-test.scm")
    79(compile-file "signal-tests.scm")
  • release/5/srfi-18/trunk/tests/signal-tests.scm

    r34718 r35501  
    11;;;; signal-tests.scm
    22
     3(module signal-tests ()
     4
     5  (import scheme
     6          (only chicken flush-output select)
     7          (chicken base)
     8          (chicken foreign)
     9          (chicken format)
     10          (chicken random)
     11          (chicken process)
     12          (chicken process signal)
     13          (chicken process-context)
     14          srfi-18)
     15
     16(print "signal-tests.scm")
    317
    418#+mingw32
     
    721  (exit))
    822
    9 
    10 (import srfi-18
    11         (chicken random) (chicken format)
    12         (chicken process-context)
    13         (chicken process) (chicken process signal))
    1423
    1524(define all-go? (make-parameter #f))
     
    5867    (tick #\.)))
    5968
     69(define posix-sleep (foreign-lambda unsigned-int "sleep" unsigned-int))
     70
    6071(let ((pid (process-fork child))
    6172      (sent1 0)
    6273      (sent2 0))
    6374  (print "Sleeping until child wakes us up") ; signal *should* interrupt the sleep
    64   (print "would have slept for " (sleep 5) " more seconds")
     75  (print "would have slept for " (posix-sleep 5) " more seconds")
    6576  (cond ((all-go?)
    6677         (print "sending signals to " pid)
    6778         (do ((i 1000 (sub1 i)))
    6879             ((zero? i))
    69            (thread-sleep! (/ (random 10) 1000))
    70            (do ((j (random 4) (sub1 j)))
     80           (thread-sleep! (/ (pseudo-random-integer 10) 1000))
     81           (do ((j (pseudo-random-integer 4) (sub1 j)))
    7182               ((zero? j))
    72              (case (random 2)
     83             (case (pseudo-random-integer 2)
    7384               ((0)
    7485                (tick #\A)
     
    8596         (process-signal pid signal/term)
    8697         (unless (all-go?) ; There's a bit of a race condition here, but that's okay
    87            (print "Would've slept for " (sleep 5) " more seconds"))
     98           (print "Would've slept for " (posix-sleep 5) " more seconds"))
    8899         (cond ((all-go?)
    89100                (print "Everything is ok!")
     
    97108              (print "terminating child process ...")
    98109              (exit 1))))
     110
     111)
  • release/5/srfi-18/trunk/tests/simple-thread-test.scm

    r34718 r35501  
    22
    33
    4 (import (chicken random) srfi-18)
     4(import chicken.random srfi-18)
    55
    66
     
    99      ((>= i 10))
    1010    (print (current-thread) " sleeps ...")
    11     (thread-sleep! (random 3)))
     11    (thread-sleep! (pseudo-random-integer 3)))
    1212  (print (current-thread) " finished."))
    1313
     14(print "simple-thread-test.scm")
    1415(thread-start! spin)
    1516(thread-start! spin)
  • release/5/srfi-18/trunk/tests/srfi-18-signal-test.scm

    r34718 r35501  
     1(print "srfi-18-signal-test.scm")
     2 
    13#+mingw32
    24(begin
     
    46  (exit))
    57
    6 (import posix srfi-18)
     8(import (chicken process signal) (chicken foreign) srfi-18)
    79
    810(define done #f)
Note: See TracChangeset for help on using the changeset viewer.