Changeset a1467c1 for libcfa


Ignore:
Timestamp:
Jul 17, 2023, 4:19:26 PM (17 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
cb344f7
Parents:
d5926ae
Message:

added support for remove and insert calls in waituntils

File:
1 edited

Legend:

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

    rd5926ae ra1467c1  
    460460}
    461461
     462// type used by select statement to capture a chan read as the selected operation that doesn't have a param to read to
     463struct chan_read_no_ret {
     464    T ret;
     465    chan_read( T ) cr;
     466};
     467__CFA_SELECT_GET_TYPE( chan_read_no_ret(T) );
     468
     469static inline void ?{}( chan_read_no_ret(T) & this, channel(T) & chan ) {
     470    this.cr{ chan, this.ret };
     471}
     472static inline chan_read_no_ret(T) remove( channel(T) & chan ) { chan_read_no_ret(T) cr{ chan }; return cr; }
     473static inline bool register_select( chan_read_no_ret(T) & this, select_node & node ) { return register_select( this.cr, node ); }
     474static inline bool unregister_select( chan_read_no_ret(T) & this, select_node & node ) { return unregister_select( this.cr, node ); }
     475static inline bool on_selected( chan_read_no_ret(T) & this, select_node & node ) { return on_selected( this.cr, node ); }
     476
    462477// type used by select statement to capture a chan write as the selected operation
    463478struct chan_write {
     
    472487}
    473488static inline chan_write(T) ?>>?( T elem, channel(T) & chan ) { chan_write(T) cw{ chan, elem }; return cw; }
     489static inline chan_write(T) insert( T elem, channel(T) & chan) { chan_write(T) cw{ chan, elem }; return cw; }
    474490
    475491static inline void __handle_select_closed_write( chan_write(T) & this, select_node & node ) with(this.chan, this) {
Note: See TracChangeset for help on using the changeset viewer.