- Timestamp:
- Jul 11, 2023, 2:27:58 PM (22 months ago)
- Branches:
- master
- Children:
- bbecdd4
- Parents:
- 4c8ce47
- Location:
- libcfa/src/concurrency
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/concurrency/channel.hfa ¶
r4c8ce47 rb93bf85 444 444 } 445 445 static inline bool unregister_select( chan_read(T) & this, select_node & node ) { return unregister_chan( this.chan, node ); } 446 static inline void on_selected( chan_read(T) & this, select_node & node ) with(this) { 447 if ( node.extra == 0p ) // check if woken up due to closed channel 448 __closed_remove( chan, ret ); 446 static inline bool on_selected( chan_read(T) & this, select_node & node ) with(this) { 447 if ( unlikely(node.extra == 0p) ) { 448 if ( !exception_in_flight() ) __closed_remove( chan, ret ); // check if woken up due to closed channel 449 else return false; 450 } 449 451 // This is only reachable if not closed or closed exception was handled 452 return true; 450 453 } 451 454 … … 536 539 static inline bool unregister_select( chan_write(T) & this, select_node & node ) { return unregister_chan( this.chan, node ); } 537 540 538 static inline void on_selected( chan_write(T) & this, select_node & node ) with(this) { 539 if ( node.extra == 0p ) // check if woken up due to closed channel 540 __closed_insert( chan, elem ); 541 541 static inline bool on_selected( chan_write(T) & this, select_node & node ) with(this) { 542 if ( unlikely(node.extra == 0p) ) { 543 if ( !exception_in_flight() ) __closed_insert( chan, elem ); // check if woken up due to closed channel 544 else return false; 545 } 542 546 // This is only reachable if not closed or closed exception was handled 547 return true; 543 548 } 544 549 -
TabularUnified libcfa/src/concurrency/future.hfa ¶
r4c8ce47 rb93bf85 180 180 } 181 181 182 void on_selected( future(T) & this, select_node & node ) {}182 bool on_selected( future(T) & this, select_node & node ) { return true; } 183 183 } 184 184 } -
TabularUnified libcfa/src/concurrency/invoke.h ¶
r4c8ce47 rb93bf85 255 255 #ifdef __cforall 256 256 extern "Cforall" { 257 static inline bool exception_in_flight() { 258 return __get_stack( &active_thread()->self_cor )->exception_context.current_exception != 0p; 259 } 260 257 261 static inline thread$ * volatile & ?`next ( thread$ * this ) { 258 262 return this->user_link.next; -
TabularUnified libcfa/src/concurrency/kernel.cfa ¶
r4c8ce47 rb93bf85 569 569 returnToKernel(); 570 570 __enable_interrupts_checked(); 571 572 571 } 573 572 -
TabularUnified libcfa/src/concurrency/locks.cfa ¶
r4c8ce47 rb93bf85 239 239 } 240 240 241 void on_selected( blocking_lock & this, select_node & node ) {}241 bool on_selected( blocking_lock & this, select_node & node ) { return true; } 242 242 243 243 //----------------------------------------------------------------------------- -
TabularUnified libcfa/src/concurrency/locks.hfa ¶
r4c8ce47 rb93bf85 112 112 static inline bool register_select( single_acquisition_lock & this, select_node & node ) { return register_select( (blocking_lock &)this, node ); } 113 113 static inline bool unregister_select( single_acquisition_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); } 114 static inline void on_selected( single_acquisition_lock & this, select_node & node ) {on_selected( (blocking_lock &)this, node ); }114 static inline bool on_selected( single_acquisition_lock & this, select_node & node ) { return on_selected( (blocking_lock &)this, node ); } 115 115 116 116 //---------- … … 129 129 static inline bool register_select( owner_lock & this, select_node & node ) { return register_select( (blocking_lock &)this, node ); } 130 130 static inline bool unregister_select( owner_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); } 131 static inline void on_selected( owner_lock & this, select_node & node ) {on_selected( (blocking_lock &)this, node ); }131 static inline bool on_selected( owner_lock & this, select_node & node ) { return on_selected( (blocking_lock &)this, node ); } 132 132 133 133 //----------------------------------------------------------------------------- … … 619 619 } 620 620 621 static inline void on_selected( simple_owner_lock & this, select_node & node ) {}621 static inline bool on_selected( simple_owner_lock & this, select_node & node ) { return true; } 622 622 623 623 -
TabularUnified libcfa/src/concurrency/select.cfa ¶
r4c8ce47 rb93bf85 49 49 return false; 50 50 } 51 void on_selected( select_timeout_node & this, select_node & node ) {}51 bool on_selected( select_timeout_node & this, select_node & node ) { return true; } 52 52 53 53 // Gateway routine to wait on duration -
TabularUnified libcfa/src/concurrency/select.hfa ¶
r4c8ce47 rb93bf85 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 voidon_selected( T &, select_node & );98 bool on_selected( T &, select_node & ); 99 99 }; 100 100 … … 208 208 bool register_select( select_timeout_node & this, select_node & node ); 209 209 bool unregister_select( select_timeout_node & this, select_node & node ); 210 voidon_selected( select_timeout_node & this, select_node & node );210 bool on_selected( select_timeout_node & this, select_node & node ); 211 211 212 212 // Gateway routines to waituntil on duration
Note: See TracChangeset
for help on using the changeset viewer.