Ignore:
Timestamp:
Nov 23, 2025, 10:54:30 PM (41 hours ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
00aa122
Parents:
8ffee9a
Message:

rename private waituntil routines register_select, unregister_select, and on_selected with tailing $

Location:
libcfa/src/concurrency
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/channel.hfa

    r8ffee9a rfbaea970  
    411411        }
    412412
    413         bool register_select( chan_read(T) & this, select_node & node ) with(*this.chan, this) {
     413        bool register_select$( chan_read(T) & this, select_node & node ) with(*this.chan, this) {
    414414            lock( mutex_lock );
    415415            node.extra = ret; // set .extra so that if it == 0p later in on_selected it is due to channel close
     
    476476            return true;
    477477        }
    478         bool unregister_select( chan_read(T) & this, select_node & node ) { return unregister_chan( *this.chan, node ); }
    479         bool on_selected( chan_read(T) & this, select_node & node ) with(this) {
     478        bool unregister_select$( chan_read(T) & this, select_node & node ) { return unregister_chan( *this.chan, node ); }
     479        bool on_selected$( chan_read(T) & this, select_node & node ) with(this) {
    480480            if ( unlikely(node.extra == 0p) ) {
    481481                if ( ! exception_in_flight() ) __closed_remove( *chan, *ret ); // check if woken up due to closed channel
     
    491491
    492492        chan_read_no_ret(T) remove( channel(T) & chan ) { chan_read_no_ret(T) c_read{ chan }; return c_read; }
    493         bool register_select( chan_read_no_ret(T) & this, select_node & node ) {
     493        bool register_select$( chan_read_no_ret(T) & this, select_node & node ) {
    494494            this.c_read.ret = &this.retval;
    495             return register_select( this.c_read, node );
    496         }
    497         bool unregister_select( chan_read_no_ret(T) & this, select_node & node ) { return unregister_select( this.c_read, node ); }
    498         bool on_selected( chan_read_no_ret(T) & this, select_node & node ) { return on_selected( this.c_read, node ); }
     495            return register_select$( this.c_read, node );
     496        }
     497        bool unregister_select$( chan_read_no_ret(T) & this, select_node & node ) { return unregister_select$( this.c_read, node ); }
     498        bool on_selected$( chan_read_no_ret(T) & this, select_node & node ) { return on_selected$( this.c_read, node ); }
    499499
    500500        void ?{}( chan_write(T) & cw, channel(T) * chan, T elem ) {
     
    511511        }
    512512
    513         bool register_select( chan_write(T) & this, select_node & node ) with(*this.chan, this) {
     513        bool register_select$( chan_write(T) & this, select_node & node ) with(*this.chan, this) {
    514514            lock( mutex_lock );
    515515            node.extra = &elem; // set .extra so that if it == 0p later in on_selected it is due to channel close
     
    577577                return true;
    578578        }
    579         bool unregister_select( chan_write(T) & this, select_node & node ) { return unregister_chan( *this.chan, node ); }
    580 
    581         bool on_selected( chan_write(T) & this, select_node & node ) with(this) {
     579        bool unregister_select$( chan_write(T) & this, select_node & node ) { return unregister_chan( *this.chan, node ); }
     580
     581        bool on_selected$( chan_write(T) & this, select_node & node ) with(this) {
    582582                if ( unlikely(node.extra == 0p) ) {
    583583                        if ( ! exception_in_flight() ) __closed_insert( *chan, elem ); // check if woken up due to closed channel
  • libcfa/src/concurrency/future.hfa

    r8ffee9a rfbaea970  
    1010// Created On       : Wed Jan 06 17:33:18 2021
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Wed Nov 19 09:26:38 2025
    13 // Update Count     : 204
     12// Last Modified On : Sun Nov 23 22:48:08 2025
     13// Update Count     : 208
    1414//
    1515
     
    5555                // PRIVATE
    5656
    57                 bool register_select( future(T) & fut, select_node & s ) with( fut ) { // for waituntil statement
     57                bool register_select$( future(T) & fut, select_node & s ) with( fut ) { // for waituntil statement
    5858                        lock( lock );
    5959
     
    7878                }
    7979
    80                 bool unregister_select( future(T) & fut, select_node & s ) with( fut ) { // for waituntil statement
     80                bool unregister_select$( future(T) & fut, select_node & s ) with( fut ) { // for waituntil statement
    8181                  if ( ! isListed( s ) ) return false;
    8282                        lock( lock );
     
    8686                }
    8787
    88                 bool on_selected( future(T) &, select_node & ) { return true; } // for waituntil statement
     88                bool on_selected$( future(T) &, select_node & ) { return true; } // for waituntil statement
    8989
    9090                // PUBLIC
     
    9898
    9999                void ?{}( future(T) & fut ) with( fut ) {
    100 //                      waiters{};
    101100                        except = 0p;
    102101                        state = FUTURE_EMPTY$;
     
    260259                // PRIVATE
    261260
    262                 bool register_select( future_rc(T) & frc, select_node & s ) with( frc ) { // for waituntil statement
    263                         return register_select( frc.impl->fut, s );
    264                 }
    265 
    266                 bool unregister_select( future_rc(T) & frc, select_node & s ) with( frc ) { // for waituntil statement
    267                         return unregister_select( frc.impl->fut, s );
    268                 }
    269 
    270                 bool on_selected( future_rc(T) &, select_node & ) { return true; } // for waituntil statement
     261                bool register_select$( future_rc(T) & frc, select_node & s ) with( frc ) { // for waituntil statement
     262                        return register_select$( frc.impl->fut, s );
     263                }
     264
     265                bool unregister_select$( future_rc(T) & frc, select_node & s ) with( frc ) { // for waituntil statement
     266                        return unregister_select$( frc.impl->fut, s );
     267                }
     268
     269                bool on_selected$( future_rc(T) &, select_node & ) { return true; } // for waituntil statement
    271270
    272271                // PUBLIC
  • libcfa/src/concurrency/locks.cfa

    r8ffee9a rfbaea970  
    186186
    187187// waituntil() support
    188 bool register_select( blocking_lock & this, select_node & node ) with(this) {
     188bool register_select$( blocking_lock & this, select_node & node ) with(this) {
    189189        lock( lock __cfaabi_dbg_ctx2 );
    190190        thread$ * thrd = active_thread();
     
    218218}
    219219
    220 bool unregister_select( blocking_lock & this, select_node & node ) with(this) {
     220bool unregister_select$( blocking_lock & this, select_node & node ) with(this) {
    221221        lock( lock __cfaabi_dbg_ctx2 );
    222222        if ( isListed( node ) ) {
     
    239239}
    240240
    241 bool on_selected( blocking_lock & this, select_node & node ) { return true; }
     241bool on_selected$( blocking_lock & this, select_node & node ) { return true; }
    242242
    243243//-----------------------------------------------------------------------------
  • libcfa/src/concurrency/locks.hfa

    r8ffee9a rfbaea970  
    1111// Created On       : Thu Jan 21 19:46:50 2021
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Mon Nov 17 20:48:55 2025
    14 // Update Count     : 63
     13// Last Modified On : Sun Nov 23 22:38:45 2025
     14// Update Count     : 67
    1515//
    1616
     
    127127static inline void on_wakeup( single_acquisition_lock & this, size_t v ) { on_wakeup ( (blocking_lock &)this, v ); }
    128128static inline void on_notify( single_acquisition_lock & this, struct thread$ * t ) { on_notify( (blocking_lock &)this, t ); }
    129 static inline bool register_select( single_acquisition_lock & this, select_node & node ) { return register_select( (blocking_lock &)this, node ); }
    130 static inline bool unregister_select( single_acquisition_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); }
    131 static inline bool on_selected( single_acquisition_lock & this, select_node & node ) { return on_selected( (blocking_lock &)this, node ); }
     129static inline bool register_select$( single_acquisition_lock & this, select_node & node ) { return register_select$( (blocking_lock &)this, node ); }
     130static inline bool unregister_select$( single_acquisition_lock & this, select_node & node ) { return unregister_select$( (blocking_lock &)this, node ); }
     131static inline bool on_selected$( single_acquisition_lock & this, select_node & node ) { return on_selected$( (blocking_lock &)this, node ); }
    132132__CFA_SELECT_GET_TYPE( single_acquisition_lock );
    133133
     
    145145static inline void on_wakeup( owner_lock & this, size_t v ) { on_wakeup ( (blocking_lock &)this, v ); }
    146146static inline void on_notify( owner_lock & this, struct thread$ * t ) { on_notify( (blocking_lock &)this, t ); }
    147 static inline bool register_select( owner_lock & this, select_node & node ) { return register_select( (blocking_lock &)this, node ); }
    148 static inline bool unregister_select( owner_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); }
    149 static inline bool on_selected( owner_lock & this, select_node & node ) { return on_selected( (blocking_lock &)this, node ); }
     147static inline bool register_select$( owner_lock & this, select_node & node ) { return register_select$( (blocking_lock &)this, node ); }
     148static inline bool unregister_select$( owner_lock & this, select_node & node ) { return unregister_select$( (blocking_lock &)this, node ); }
     149static inline bool on_selected$( owner_lock & this, select_node & node ) { return on_selected$( (blocking_lock &)this, node ); }
    150150__CFA_SELECT_GET_TYPE( owner_lock );
    151151
     
    611611
    612612// waituntil() support
    613 static inline bool register_select( simple_owner_lock & this, select_node & node ) with( this ) {
     613static inline bool register_select$( simple_owner_lock & this, select_node & node ) with( this ) {
    614614        lock( lock __cfaabi_dbg_ctx2 );
    615615
     
    643643}
    644644
    645 static inline bool unregister_select( simple_owner_lock & this, select_node & node ) with( this ) {
     645static inline bool unregister_select$( simple_owner_lock & this, select_node & node ) with( this ) {
    646646        lock( lock __cfaabi_dbg_ctx2 );
    647647        if ( isListed( node ) ) {
     
    661661}
    662662
    663 static inline bool on_selected( simple_owner_lock & /*this*/, select_node & /*node*/ ) { return true; }
     663static inline bool on_selected$( simple_owner_lock & /*this*/, select_node & /*node*/ ) { return true; }
    664664__CFA_SELECT_GET_TYPE( simple_owner_lock );
    665665
  • libcfa/src/concurrency/select.cfa

    r8ffee9a rfbaea970  
    1010// Author           : Colby Alexander Parsons
    1111// Created On       : Thu Apr 21 19:46:50 2023
    12 // Last Modified By : Kyoung Seo
    13 // Last Modified On : Wed Mar 19 12:00:00 2025
    14 // Update Count     : 1
     12// Last Modified By : Peter A. Buhr
     13// Last Modified On : Sun Nov 23 22:38:53 2025
     14// Update Count     : 4
    1515//
    1616
     
    3939
    4040// Selectable trait routines
    41 bool register_select( select_timeout_node & this, select_node & node ) {
     41bool register_select$( select_timeout_node & this, select_node & node ) {
    4242    this.s_node = &node;
    4343    node.extra = 0p;
     
    4545    return false;
    4646}
    47 bool unregister_select( select_timeout_node & this, select_node & node ) {
     47bool unregister_select$( select_timeout_node & this, select_node & node ) {
    4848    unregister_self( &this.a_node );
    4949    return false;
    5050}
    51 bool on_selected( select_timeout_node & this, select_node & node ) { return true; }
     51bool on_selected$( select_timeout_node & this, select_node & node ) { return true; }
    5252
  • libcfa/src/concurrency/select.hfa

    r8ffee9a rfbaea970  
    1111// Created On       : Thu Jan 21 19:46:50 2023
    1212// Last Modified By : Peter A. Buhr
    13 // Last Modified On : Fri Apr 25 07:31:26 2025
    14 // Update Count     : 5
     13// Last Modified On : Sun Nov 23 22:38:36 2025
     14// Update Count     : 8
    1515//
    1616
     
    8787        // For registering a select stmt on a selectable concurrency primitive
    8888        // Returns bool that indicates if operation is already SAT
    89         bool register_select( T &, select_node & );
     89        bool register_select$( T &, select_node & );
    9090
    9191        // For unregistering a select stmt on a selectable concurrency primitive
    9292        // If true is returned then the corresponding code block is run (only in non-special OR case and only if node status is not RUN)
    93         bool unregister_select( T &, select_node & );
     93        bool unregister_select$( T &, select_node & );
    9494
    9595        // This routine is run on the selecting thread prior to executing the statement corresponding to the select_node
    9696        //      passed as an arg to this routine. If true is returned proceed as normal, if false is returned the statement is skipped
    97         bool on_selected( T &, select_node & );
     97        bool on_selected$( T &, select_node & );
    9898};
    9999// Used inside the compiler to allow for overloading on return type for operations such as '?<<?' for channels
     
    209209
    210210// Selectable trait routines
    211 bool register_select( select_timeout_node & this, select_node & node );
    212 bool unregister_select( select_timeout_node & this, select_node & node );
    213 bool on_selected( select_timeout_node & this, select_node & node );
     211bool register_select$( select_timeout_node & this, select_node & node );
     212bool unregister_select$( select_timeout_node & this, select_node & node );
     213bool on_selected$( select_timeout_node & this, select_node & node );
    214214select_timeout_node __CFA_select_get_type( select_timeout_node this );
    215215
Note: See TracChangeset for help on using the changeset viewer.