Changeset ca22a7c


Ignore:
Timestamp:
Jul 18, 2023, 9:33:12 AM (12 months ago)
Author:
caparsons <caparson@…>
Branches:
master
Children:
daf4c89
Parents:
cb344f7
Message:

removed ambiguous waituntil remove support

File:
1 edited

Legend:

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

    rcb344f7 rca22a7c  
    326326    return retval;
    327327}
     328
    328329///////////////////////////////////////////////////////////////////////////////////////////
    329330// The following is Go-style operator support for channels
    330331///////////////////////////////////////////////////////////////////////////////////////////
    331332
    332 static inline void ?>>?( T elem, channel(T) & chan ) { insert( chan, elem ); }
     333static inline void ?<<?( channel(T) & chan, T elem ) { insert( chan, elem ); }
    333334static inline void ?<<?( T & ret, channel(T) & chan ) { ret = remove( chan ); }
    334335
     
    460461}
    461462
    462 // type used by select statement to capture a chan read as the selected operation that doesn't have a param to read to
    463 struct chan_read_no_ret {
    464     T ret;
    465     chan_read( T ) cr;
    466 };
    467 __CFA_SELECT_GET_TYPE( chan_read_no_ret(T) );
    468 
    469 static inline void ?{}( chan_read_no_ret(T) & this, channel(T) & chan ) {
    470     this.cr{ chan, this.ret };
    471 }
    472 static inline chan_read_no_ret(T) remove( channel(T) & chan ) { chan_read_no_ret(T) cr{ chan }; return cr; }
    473 static inline bool register_select( chan_read_no_ret(T) & this, select_node & node ) { return register_select( this.cr, node ); }
    474 static inline bool unregister_select( chan_read_no_ret(T) & this, select_node & node ) { return unregister_select( this.cr, node ); }
    475 static inline bool on_selected( chan_read_no_ret(T) & this, select_node & node ) { return on_selected( this.cr, node ); }
    476 
    477463// type used by select statement to capture a chan write as the selected operation
    478464struct chan_write {
     
    486472    memcpy( (void *)&cw.elem, (void *)&elem, sizeof(T) );
    487473}
    488 static inline chan_write(T) ?>>?( T elem, channel(T) & chan ) { chan_write(T) cw{ chan, elem }; return cw; }
     474static inline chan_write(T) ?<<?( channel(T) & chan, T elem ) { chan_write(T) cw{ chan, elem }; return cw; }
    489475static inline chan_write(T) insert( T elem, channel(T) & chan) { chan_write(T) cw{ chan, elem }; return cw; }
    490476
Note: See TracChangeset for help on using the changeset viewer.