Changeset 34983 in project


Ignore:
Timestamp:
01/04/18 21:07:24 (6 months ago)
Author:
kon
Message:

iso , comm

File:
1 edited

Legend:

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

    r34981 r34983  
    102102      proc ) ) )
    103103
     104(define-inline (<atom>-mutex atm)
     105  atm )
     106
    104107(define-inline (<atom>? obj)
    105108  (and
     
    110113  (check-structure loc obj 'mutex argnam) )
    111114
    112 (define-inline (<atom>-mutex atm)
    113   atm )
     115(define-inline (<atom>-wrapped-value atm)
     116  (mutex-specific (<atom>-mutex atm)) )
    114117
    115118(define-inline (<atom>-value atm)
    116   (let ((val (mutex-specific atm)))
     119  (let ((val (<atom>-wrapped-value atm)))
    117120    (if (procedure? val) (val) val) ) )
    118121
     
    120123(define-inline (<atom>-value-set! atm val)
    121124  (let* (
    122     (oldval (mutex-specific atm) )
     125    (oldval (<atom>-wrapped-value atm) )
    123126    (newval (if (procedure? oldval) (oldval val) val) ) )
    124127    ;
    125     (mutex-specific-set! atm newval) )
     128    (mutex-specific-set! (<atom>-mutex atm) newval) )
    126129  ;need true return; chain return
    127130  atm )
     
    190193(define: (atom (val *)) --> <atom>
    191194  (if (procedure? val)
    192     (<atom>-value-set! (make-<atom>-wrapping identity) val)
     195    (<atom>-value-set! (atom-wrap identity) val)
    193196    (make-<atom> val) ) )
    194197
     
    196199;side-effects are extra - so validators and watchers are possible
    197200;via a suitable {{mut}}
    198 ;- (atom-mutator atom <func/1>)
    199 ;- (atom-validator atom <func/1>)
    200 ;- (atom-watcher atom <func/1>)
    201201;
    202202(define: (atom-wrap (mut procedure)) --> <atom>
     
    245245    (id (or id (gensym 'atom-advise)) )
    246246    ;
    247     ;create wrap proc & then 'advise it (advice egg)
     247    ;locate/create wrap proc & then 'advise it (advice egg)
    248248    id ) )
     249
    249250(define: (atom-unadvise (mode symbol) (atm <atom>) (id symbol))
    250251  (void) )
Note: See TracChangeset for help on using the changeset viewer.