Changeset 70a4ed5 for libcfa/src
- Timestamp:
- Jun 1, 2023, 11:55:09 AM (19 months ago)
- Branches:
- ast-experimental, master
- Children:
- fc0996a
- Parents:
- 8913de4
- Location:
- libcfa/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/weakso_locks.cfa
r8913de4 r70a4ed5 30 30 bool register_select( blocking_lock & this, select_node & node ) { return false; } 31 31 bool unregister_select( blocking_lock & this, select_node & node ) { return false; } 32 bool on_selected( blocking_lock & this, select_node & node ) { return true;}32 void on_selected( blocking_lock & this, select_node & node ) {} 33 33 -
libcfa/src/concurrency/channel.hfa
r8913de4 r70a4ed5 423 423 } 424 424 static inline bool unregister_select( chan_read(T) & this, select_node & node ) { return unregister_chan( this.chan, node ); } 425 static inline boolon_selected( chan_read(T) & this, select_node & node ) with(this) {425 static inline void on_selected( chan_read(T) & this, select_node & node ) with(this) { 426 426 if ( node.extra == 0p ) // check if woken up due to closed channel 427 427 __closed_remove( chan, ret ); 428 428 // This is only reachable if not closed or closed exception was handled 429 return true;430 429 } 431 430 … … 515 514 static inline bool unregister_select( chan_write(T) & this, select_node & node ) { return unregister_chan( this.chan, node ); } 516 515 517 static inline boolon_selected( chan_write(T) & this, select_node & node ) with(this) {516 static inline void on_selected( chan_write(T) & this, select_node & node ) with(this) { 518 517 if ( node.extra == 0p ) // check if woken up due to closed channel 519 518 __closed_insert( chan, elem ); 520 519 521 520 // This is only reachable if not closed or closed exception was handled 522 return true;523 521 } 524 522 -
libcfa/src/concurrency/future.hfa
r8913de4 r70a4ed5 70 70 // check if the future is available 71 71 // currently no mutual exclusion because I can't see when you need this call to be synchronous or protected 72 bool available( future(T) & this ) { return this.state; }72 bool available( future(T) & this ) { return __atomic_load_n( &this.state, __ATOMIC_RELAXED ); } 73 73 74 74 … … 180 180 } 181 181 182 bool on_selected( future(T) & this, select_node & node ) { return true;}182 void on_selected( future(T) & this, select_node & node ) {} 183 183 } 184 184 } 185 185 186 186 //-------------------------------------------------------------------------------------------------------- 187 // These futures below do not support select statements so they may not be as usefulas 'future'187 // These futures below do not support select statements so they may not have as many features as 'future' 188 188 // however the 'single_future' is cheap and cheerful and is most likely more performant than 'future' 189 189 // since it uses raw atomics and no locks -
libcfa/src/concurrency/locks.cfa
r8913de4 r70a4ed5 239 239 } 240 240 241 bool on_selected( blocking_lock & this, select_node & node ) { return true;}241 void on_selected( blocking_lock & this, select_node & node ) {} 242 242 243 243 //----------------------------------------------------------------------------- -
libcfa/src/concurrency/locks.hfa
r8913de4 r70a4ed5 114 114 static inline bool register_select( single_acquisition_lock & this, select_node & node ) { return register_select( (blocking_lock &)this, node ); } 115 115 static inline bool unregister_select( single_acquisition_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); } 116 static inline bool on_selected( single_acquisition_lock & this, select_node & node ) { returnon_selected( (blocking_lock &)this, node ); }116 static inline void on_selected( single_acquisition_lock & this, select_node & node ) { on_selected( (blocking_lock &)this, node ); } 117 117 118 118 //---------- … … 131 131 static inline bool register_select( owner_lock & this, select_node & node ) { return register_select( (blocking_lock &)this, node ); } 132 132 static inline bool unregister_select( owner_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); } 133 static inline bool on_selected( owner_lock & this, select_node & node ) { returnon_selected( (blocking_lock &)this, node ); }133 static inline void on_selected( owner_lock & this, select_node & node ) { on_selected( (blocking_lock &)this, node ); } 134 134 135 135 //----------------------------------------------------------------------------- … … 621 621 } 622 622 623 static inline bool on_selected( simple_owner_lock & this, select_node & node ) { return true;}623 static inline void on_selected( simple_owner_lock & this, select_node & node ) {} 624 624 625 625 -
libcfa/src/concurrency/select.cfa
r8913de4 r70a4ed5 49 49 return false; 50 50 } 51 bool on_selected( select_timeout_node & this, select_node & node ) { return true;}51 void on_selected( select_timeout_node & this, select_node & node ) {} 52 52 53 53 // Gateway routine to wait on duration -
libcfa/src/concurrency/select.hfa
r8913de4 r70a4ed5 91 91 // For unregistering a select stmt on a selectable concurrency primitive 92 92 // 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 & ); 94 94 95 95 // This routine is run on the selecting thread prior to executing the statement corresponding to the select_node 96 96 // passed as an arg to this routine 97 97 // If on_selected returns false, the statement is not run, if it returns true it is run. 98 boolon_selected( T &, select_node & );98 void on_selected( T &, select_node & ); 99 99 }; 100 100 … … 188 188 bool register_select( select_timeout_node & this, select_node & node ); 189 189 bool unregister_select( select_timeout_node & this, select_node & node ); 190 boolon_selected( select_timeout_node & this, select_node & node );190 void on_selected( select_timeout_node & this, select_node & node ); 191 191 192 192 // Gateway routines to waituntil on duration
Note: See TracChangeset
for help on using the changeset viewer.