Changeset 38939 in project


Ignore:
Timestamp:
08/30/20 19:07:27 (4 weeks ago)
Author:
Kon Lovett
Message:

add -strict-types, type is interface

Location:
release/5/thread-utils/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/thread-utils/trunk/thread-reaper.scm

    r38686 r38939  
    4646(import (only thread-utils check-thread print-exception-warning))
    4747(import (only type-checks check-positive-number check-natural-fixnum))
     48
     49;;
     50
     51(: zombie-threads (-> list))
     52(: thread-reaper-shutdown? (-> boolean))
     53(: thread-reap! (thread -> void))
     54(: thread-reaper-stop! (-> void))
     55(: thread-reaper-greedy (-> boolean))
     56(: thread-reaper-greedy-set! (boolean -> void))
     57(: thread-reaper-quantum (-> fixnum))
     58(: thread-reaper-quantum-set! (fixnum -> void))
     59(: thread-reaper-wait-seconds (-> number))
     60(: thread-reaper-wait-seconds-set! (number -> void))
     61(: thread-reaper-timeout (-> number))
     62(: thread-reaper-timeout-set! (number -> void))
     63(: thread-reaper-retries (-> fixnum))
     64(: thread-reaper-retries-set! (fixnum -> void))
    4865
    4966;;
     
    223240(define thread-reaper-greedy
    224241  (getter-with-setter
    225     (lambda args
    226       (if (null? args) *greedy?*
    227         (begin
    228           (warning 'thread-reaper-greedy "mutation deprecated")
    229           (thread-reaper-greedy-set! (car args)) ) ) )
     242    (lambda args *greedy?*)
    230243     thread-reaper-greedy-set!))
    231244
     
    238251    (lambda args
    239252      (unless *reaper-thread* (error 'thread-reaper-quantum "reaper is not running"))
    240       (if (null? args) (thread-quantum *reaper-thread*)
    241         (begin
    242           (warning 'thread-reaper-quantum "mutation deprecated")
    243           (thread-reaper-quantum-set! (car args)) ) ) )
     253      (thread-quantum *reaper-thread*))
    244254    thread-reaper-quantum-set!))
    245255
     
    249259(define thread-reaper-wait-seconds
    250260  (getter-with-setter
    251     (lambda args
    252       (if (null? args) *wait-seconds*
    253         (begin
    254           (warning 'thread-reaper-wait-seconds "mutation deprecated")
    255           (thread-reaper-wait-seconds-set! (car args)) ) ) )
     261    (lambda args *wait-seconds*)
    256262    thread-reaper-wait-seconds-set!))
    257263
     
    261267(define thread-reaper-timeout
    262268  (getter-with-setter
    263     (lambda args
    264       (if (null? args) *timeout*
    265         (begin
    266           (warning 'thread-timeout "mutation deprecated")
    267           (thread-reaper-timeout-set! (car args)) ) ) )
     269    (lambda args *timeout*)
    268270    thread-reaper-timeout-set!))
    269271
     
    273275(define thread-reaper-retries
    274276  (getter-with-setter
    275     (lambda args
    276       (if (null? args) *retries*
    277         (begin
    278           (warning 'thread-reaper-retries "mutation deprecated")
    279           (thread-reaper-retries-set! (car args)) ) ) )
     277    (lambda args *retries*)
    280278    thread-reaper-retries-set!))
    281279
  • release/5/thread-utils/trunk/thread-utils.egg

    r38565 r38939  
    1818  (extension thread-utils
    1919    (types-file)
    20     (csc-options "-O3" "-d1" "-local" "-no-procedure-checks"))
     20    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks"))
    2121  (extension thread-reaper
    2222    (types-file)
    2323    (component-dependencies thread-utils)
    24     (csc-options "-O3" "-d1" "-local" "-no-procedure-checks")) ) )
     24    (csc-options "-O3" "-d1" "-strict-types" "-no-procedure-checks")) ) )
  • release/5/thread-utils/trunk/thread-utils.scm

    r38686 r38939  
    7979  mutex? time? seconds->time time->seconds current-time))
    8080(import (only type-checks define-check+error-type))
     81
     82;;
     83
     84(: thread-created? (thread -> boolean))
     85(: thread-ready? (thread -> boolean))
     86(: thread-running? (thread -> boolean))
     87(: thread-blocked? (thread -> boolean))
     88(: thread-suspended? (thread -> boolean))
     89(: thread-sleeping? (thread -> boolean))
     90(: thread-terminated? (thread -> boolean))
     91(: thread-dead? (thread -> boolean))
     92(: thread-obstructed? (thread -> boolean))
     93(: thread-state=? (thread * -> boolean))
     94(: thread-blocked-for-object (thread -> *))
     95(: thread-blocked-for-termination? (thread -> boolean))
     96(: thread-blocked-for-timeout? (thread -> boolean))
     97(: thread-blocked-for-io? (thread -> boolean))
     98(: thread-unblock! (thread -> void))
     99#| ;SRFI-18
     100(: thread-state (thread -> *))
     101(: thread-name (thread -> *))
     102(: thread-quantum (thread -> *))
     103(: thread-specific (thread -> *))
     104|#
     105(: thread-thunk (thread -> procedure))
     106(: thread-result-list (thread -> (or boolean list)))
     107(: thread-block-timeout (thread -> (or boolean float)))
     108(: thread-state-buffer (thread -> vector))
     109(: thread-end-exception (thread -> *))
     110(: thread-owned-mutexes (thread -> list))
     111(: thread-block-object (thread -> *))
     112(: thread-recipients (thread -> list))
     113(: thread-recipients (thread -> list))
     114(: thread-recipients (thread -> list))
     115(: thread-recipients (thread -> list))
     116(: unblocked-by-timeout? (thread -> boolean))
     117(: thread-dynamic-winds (thread -> list))
     118(: thread-standard-input (thread -> port))
     119(: thread-standard-output (thread -> port))
     120(: thread-standard-error (thread -> port))
     121(: thread-default-exception-handler (thread -> procedure))
     122(: thread-current-parameter-vector (thread -> vector))
    81123
    82124;; Thread Messages
     
    170212;;
    171213
    172 (: thread-state=? (thread * -> boolean))
    173 ;
    174214(define (thread-state=? th tk) (eq? tk (thread-state th)))
    175215
    176 (: thread-created? (thread -> boolean))
    177 (: thread-ready? (thread -> boolean))
    178 (: thread-running? (thread -> boolean))
    179 (: thread-blocked? (thread -> boolean))
    180 (: thread-suspended? (thread -> boolean))
    181 (: thread-sleeping? (thread -> boolean))
    182 (: thread-terminated? (thread -> boolean))
    183 (: thread-dead? (thread -> boolean))
    184 (: thread-obstructed? (thread -> boolean))
    185 ;
    186216(define (thread-created? th)      (thread-state=? th 'created))
    187217(define (thread-ready? th)        (thread-state=? th 'ready))
     
    196226;;
    197227
    198 (: thread-blocked-for-object (thread -> *))
    199228;
    200229(define (*thread-blocked-for-object th)
     
    203232    (*thread-block-object th)) )
    204233
    205 (: thread-blocked-for-termination? (thread -> boolean))
    206234;
    207235(define (thread-blocked-for-termination? th)
     
    212240    #t ) )
    213241
    214 (: thread-blocked-for-timeout? (thread -> boolean))
    215242;
    216243(define (thread-blocked-for-timeout? th)
     
    221248    #t ) )
    222249
    223 (: thread-blocked-for-io? (thread -> boolean))
    224250;
    225251(define (thread-blocked-for-io? th)
     
    235261;;
    236262
    237 (: thread-unblock! (thread -> void))
    238263;
    239264(define (thread-unblock! th)
     
    254279
    255280#| ;SRFI-18
    256 (: thread-state (thread -> *))
    257 ;
    258281(define (thread-state th)
    259282        (*thread-state (check-thread 'thread-state th)) )
    260 (: thread-name (thread -> *))
    261 ;
     283
    262284(define (thread-name th)
    263285        (*thread-name (check-thread 'thread-name th)) )
    264286
    265 (: thread-quantum (thread -> *))
    266 ;
    267287(define (thread-quantum th)
    268288        (*thread-quantum (check-thread 'thread-quantum th)) )
    269289
    270 (: thread-specific (thread -> *))
    271 ;
    272290(define (thread-specific th)
    273291        (*thread-specific (check-thread 'thread-specific th)) )
    274292|#
    275293
    276 (: thread-thunk (thread -> procedure))
    277 ;
    278294(define (thread-thunk th)
    279295        (*thread-thunk (check-thread 'thread-thunk th)) )
    280296
    281 (: thread-result-list (thread -> (or boolean list)))
    282 ;
    283297(define (thread-result-list th)
    284298        (*thread-result-list (check-thread 'thread-result-list th)) )
    285299
    286 (: thread-block-timeout (thread -> (or boolean float)))
    287300(define (thread-block-timeout th)
    288301        (*thread-block-timeout (check-thread 'thread-block-timeout th)) )
    289302
    290 (: thread-state-buffer (thread -> vector))
    291 ;
    292303(define (thread-state-buffer th)
    293304        (*thread-state-buffer (check-thread 'thread-state-buffer th)) )
    294305
    295 (: thread-end-exception (thread -> *))
    296 ;
    297306(define (thread-end-exception th)
    298307        (*thread-end-exception (check-thread 'thread-end-exception th)) )
    299308
    300 (: thread-owned-mutexes (thread -> list))
    301 ;
    302309(define (thread-owned-mutexes th)
    303310        (*thread-owned-mutexes (check-thread 'thread-owned-mutexes th)) )
    304311
    305 (: thread-block-object (thread -> *))
    306 ;
    307312(define (thread-block-object th)
    308313        (*thread-block-object (check-thread 'thread-block-object th)) )
    309314
    310 (: thread-recipients (thread -> list))
    311 ;
    312315(define (thread-recipients th)
    313316        (*thread-recipients (check-thread 'thread-recipients th)) )
    314317
    315 (: unblocked-by-timeout? (thread -> boolean))
    316 ;
    317318(define (unblocked-by-timeout? th)
    318319        (*unblocked-by-timeout? (check-thread 'unblocked-by-timeout? th)) )
     
    320321;;
    321322
    322 (: thread-dynamic-winds (thread -> list))
    323 ;
    324323(define (thread-dynamic-winds th)
    325324        (*state-buffer-dynamic-winds (*thread-state-buffer (check-thread 'thread-dynamic-winds th))) )
    326325
    327 (: thread-standard-input (thread -> port))
    328 ;
    329326(define (thread-standard-input th)
    330327        (*state-buffer-standard-input (*thread-state-buffer (check-thread 'thread-standard-input th))) )
    331328
    332 (: thread-standard-output (thread -> port))
    333 ;
    334329(define (thread-standard-output th)
    335330        (*state-buffer-standard-output (*thread-state-buffer (check-thread 'thread-standard-output th))) )
    336331
    337 (: thread-standard-error (thread -> port))
    338 ;
    339332(define (thread-standard-error th)
    340333        (*state-buffer-standard-error (*thread-state-buffer (check-thread 'thread-standard-error th))) )
    341334
    342 (: thread-default-exception-handler (thread -> procedure))
    343 ;
    344335(define (thread-default-exception-handler th)
    345336        (*state-buffer-default-exception-handler (*thread-state-buffer (check-thread 'thread-default-exception-handler th))) )
    346337
    347 (: thread-current-parameter-vector (thread -> vector))
    348 ;
    349338(define (thread-current-parameter-vector th)
    350339        (*state-buffer-current-parameter-vector (*thread-state-buffer (check-thread 'thread-current-parameter-vector th))) )
Note: See TracChangeset for help on using the changeset viewer.