Changeset 35425 in project


Ignore:
Timestamp:
04/22/18 02:23:03 (5 weeks ago)
Author:
kon
Message:

type deprecated, canon form

File:
1 edited

Legend:

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

    r34995 r35425  
    213213
    214214(: thread-state=? ((struct thread) * --> boolean))
     215;
    215216(define (thread-state=? th tk)
    216217        (eq? tk (thread-state th)) )
    217218
    218219(: thread-created? ((struct thread) --> boolean))
     220;
    219221(define (thread-created? th)
    220222        (thread-state=? th 'created) )
    221223
    222224(: thread-ready? ((struct thread) --> boolean))
     225;
    223226(define (thread-ready? th)
    224227        (thread-state=? th 'ready) )
    225228
    226229(: thread-running? ((struct thread) --> boolean))
     230;
    227231(define (thread-running? th)
    228232        (thread-state=? th 'running) )
    229233
    230234(: thread-blocked? ((struct thread) --> boolean))
     235;
    231236(define (thread-blocked? th)
    232237        (thread-state=? th 'blocked) )
    233238
    234239(: thread-suspended? ((struct thread) --> boolean))
     240;
    235241(define (thread-suspended? th)
    236242        (thread-state=? th 'suspended) )
    237243
    238244(: thread-sleeping? ((struct thread) --> boolean))
     245;
    239246(define (thread-sleeping? th)
    240247        (thread-state=? th 'sleeping) )
    241248
    242249(: thread-terminated? ((struct thread) --> boolean))
     250;
    243251(define (thread-terminated? th)
    244252        (thread-state=? th 'terminated) )
    245253
    246254(: thread-dead? ((struct thread) --> boolean))
     255;
    247256(define (thread-dead? th)
    248257        (thread-state=? th 'dead) )
    249258
    250259(: thread-obstructed? ((struct thread) --> boolean))
     260;
    251261(define (thread-obstructed? th)
    252262        (or (thread-blocked? th) (thread-sleeping? th)) )
     
    255265
    256266(: thread-blocked-for-object ((struct thread) --> *))
     267;
    257268(define (*thread-blocked-for-object th)
    258269  (and
     
    261272
    262273(: thread-blocked-for-termination? ((struct thread) --> boolean))
     274;
    263275(define (thread-blocked-for-termination? th)
    264276  (and
     
    269281
    270282(: thread-blocked-for-timeout? ((struct thread) --> boolean))
     283;
    271284(define (thread-blocked-for-timeout? th)
    272285  (and
     
    277290
    278291(: thread-blocked-for-io? ((struct thread) --> boolean))
     292;
    279293(define (thread-blocked-for-io? th)
    280294  (and-let* ((obj (*thread-blocked-for-object th)))
     
    290304
    291305(: thread-unblock! ((struct thread) -> void))
     306;
    292307(define (thread-unblock! th)
    293308  (when (thread-blocked-for-timeout? th)
     
    305320
    306321(: thread-thunk ((struct thread) --> procedure))
     322;
    307323(define (thread-thunk th)
    308324        (*thread-thunk (check-thread 'thread-thunk th)) )
    309325
    310326(: thread-result-list ((struct thread) --> (or boolean list)))
     327;
    311328(define (thread-result-list th)
    312329        (*thread-result-list (check-thread 'thread-result-list th)) )
    313330
    314 #;
    315 (: thread-state ((struct thread) --> *))
    316 #;
    317 (define (thread-state th)
     331#;(: thread-state ((struct thread) --> *))
     332;
     333#;(define (thread-state th)
    318334        (*thread-state (check-thread 'thread-state th)) )
    319335
    320336(: thread-block-timeout ((struct thread) --> (or boolean float)))
    321 (define (thread-block-timeout th)
     337v(define (thread-block-timeout th)
    322338        (*thread-block-timeout (check-thread 'thread-block-timeout th)) )
    323339
    324340(: thread-state-buffer ((struct thread) --> vector))
     341;
    325342(define (thread-state-buffer th)
    326343        (*thread-state-buffer (check-thread 'thread-state-buffer th)) )
    327344
    328 #;
    329 (: thread-name ((struct thread) --> *))
    330 #;
    331 (define (thread-name th)
     345#;(: thread-name ((struct thread) --> *))
     346;
     347#;(define (thread-name th)
    332348        (*thread-name (check-thread 'thread-name th)) )
    333349
    334350(: thread-end-exception ((struct thread) --> *))
     351;
    335352(define (thread-end-exception th)
    336353        (*thread-end-exception (check-thread 'thread-end-exception th)) )
    337354
    338355(: thread-owned-mutexes ((struct thread) --> list))
     356;
    339357(define (thread-owned-mutexes th)
    340358        (*thread-owned-mutexes (check-thread 'thread-owned-mutexes th)) )
    341359
    342 #;
    343 (: thread-quantum ((struct thread) --> *))
    344 #;
    345 (define (thread-quantum th)
     360#;(: thread-quantum ((struct thread) --> *))
     361;
     362#;(define (thread-quantum th)
    346363        (*thread-quantum (check-thread 'thread-quantum th)) )
    347364
    348 #;
    349 (: thread-specific ((struct thread) --> *))
    350 #;
    351 (define (thread-specific th)
     365#;(: thread-specific ((struct thread) --> *))
     366;
     367#;(define (thread-specific th)
    352368        (*thread-specific (check-thread 'thread-specific th)) )
    353369
    354370(: thread-block-object ((struct thread) --> *))
     371;
    355372(define (thread-block-object th)
    356373        (*thread-block-object (check-thread 'thread-block-object th)) )
    357374
    358375(: thread-recipients ((struct thread) --> list))
     376;
    359377(define (thread-recipients th)
    360378        (*thread-recipients (check-thread 'thread-recipients th)) )
    361379
    362380(: unblocked-by-timeout? ((struct thread) --> boolean))
     381;
    363382(define (unblocked-by-timeout? th)
    364383        (*unblocked-by-timeout? (check-thread 'unblocked-by-timeout? th)) )
     
    367386
    368387(: thread-dynamic-winds ((struct thread) --> list))
     388;
    369389(define (thread-dynamic-winds th)
    370390        (*state-buffer-dynamic-winds (*thread-state-buffer (check-thread 'thread-dynamic-winds th))) )
    371391
    372392(: thread-standard-input ((struct thread) --> port))
     393;
    373394(define (thread-standard-input th)
    374395        (*state-buffer-standard-input (*thread-state-buffer (check-thread 'thread-standard-input th))) )
    375396
    376397(: thread-standard-output ((struct thread) --> port))
     398;
    377399(define (thread-standard-output th)
    378400        (*state-buffer-standard-output (*thread-state-buffer (check-thread 'thread-standard-output th))) )
    379401
    380402(: thread-standard-error ((struct thread) --> port))
     403;
    381404(define (thread-standard-error th)
    382405        (*state-buffer-standard-error (*thread-state-buffer (check-thread 'thread-standard-error th))) )
    383406
    384407(: thread-default-exception-handler ((struct thread) --> procedure))
     408;
    385409(define (thread-default-exception-handler th)
    386410        (*state-buffer-default-exception-handler (*thread-state-buffer (check-thread 'thread-default-exception-handler th))) )
    387411
    388412(: thread-current-parameter-vector ((struct thread) --> vector))
     413;
    389414(define (thread-current-parameter-vector th)
    390415        (*state-buffer-current-parameter-vector (*thread-state-buffer (check-thread 'thread-current-parameter-vector th))) )
     
    402427;DEPRECATED
    403428
     429(: thread-blocked?/termination deprecated)
    404430(define thread-blocked?/termination thread-blocked-for-termination?)
     431
     432(: thread-blocked?/io deprecated)
    405433(define thread-blocked?/io thread-blocked-for-io?)
     434
     435(: thread-blocked?/timeout deprecated)
    406436(define thread-blocked?/timeout thread-blocked-for-timeout?)
    407437
Note: See TracChangeset for help on using the changeset viewer.