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

add -strict-types, type is interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.