Changeset bf55f32 for libcfa/src/concurrency
- Timestamp:
- Jul 17, 2023, 3:59:29 PM (20 months ago)
- Branches:
- master
- Children:
- 5adb277
- Parents:
- 1d66a91
- Location:
- libcfa/src/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/channel.hfa
r1d66a91 rbf55f32 330 330 /////////////////////////////////////////////////////////////////////////////////////////// 331 331 332 //static inline void ?>>?( T elem, channel(T) & chan ) { insert( chan, elem ); }333 //static inline void ?<<?( T & ret, channel(T) & chan ) { ret = remove( chan ); }332 static inline void ?>>?( T elem, channel(T) & chan ) { insert( chan, elem ); } 333 static inline void ?<<?( T & ret, channel(T) & chan ) { ret = remove( chan ); } 334 334 335 335 /////////////////////////////////////////////////////////////////////////////////////////// … … 372 372 channel(T) & chan; 373 373 }; 374 __CFA_SELECT_GET_TYPE( chan_read(T) ); 374 375 375 376 static inline void ?{}( chan_read(T) & cr, channel(T) & chan, T & ret ) { … … 464 465 channel(T) & chan; 465 466 }; 467 __CFA_SELECT_GET_TYPE( chan_write(T) ); 466 468 467 469 static inline void ?{}( chan_write(T) & cw, channel(T) & chan, T elem ) { -
libcfa/src/concurrency/future.hfa
r1d66a91 rbf55f32 39 39 futex_mutex lock; 40 40 }; 41 __CFA_SELECT_GET_TYPE( future(T) ); 41 42 42 43 struct future_node { -
libcfa/src/concurrency/locks.hfa
r1d66a91 rbf55f32 113 113 static inline bool unregister_select( single_acquisition_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); } 114 114 static inline bool on_selected( single_acquisition_lock & this, select_node & node ) { return on_selected( (blocking_lock &)this, node ); } 115 __CFA_SELECT_GET_TYPE( single_acquisition_lock ); 115 116 116 117 //---------- … … 130 131 static inline bool unregister_select( owner_lock & this, select_node & node ) { return unregister_select( (blocking_lock &)this, node ); } 131 132 static inline bool on_selected( owner_lock & this, select_node & node ) { return on_selected( (blocking_lock &)this, node ); } 133 __CFA_SELECT_GET_TYPE( owner_lock ); 132 134 133 135 //----------------------------------------------------------------------------- … … 620 622 621 623 static inline bool on_selected( simple_owner_lock & this, select_node & node ) { return true; } 622 624 __CFA_SELECT_GET_TYPE( simple_owner_lock ); 623 625 624 626 //----------------------------------------------------------------------------- -
libcfa/src/concurrency/select.hfa
r1d66a91 rbf55f32 94 94 95 95 // This routine is run on the selecting thread prior to executing the statement corresponding to the select_node 96 // passed as an arg to this routine 97 // If on_selected returns false, the statement is not run if the on_selected call occured as 98 // part of a statement block that only ran due to an unregister_select that returned true 99 // In all other executions the return value is ignored. 96 // passed as an arg to this routine. If true is returned proceed as normal, if false is returned the statement is skipped 100 97 bool on_selected( T &, select_node & ); 101 98 }; 99 // Used inside the compiler to allow for overloading on return type for operations such as '?<<?' for channels 100 // YOU MUST USE THIS MACRO OR INCLUDE AN EQUIVALENT DECL FOR YOUR TYPE TO SUPPORT WAITUNTIL 101 #define __CFA_SELECT_GET_TYPE( typename ) typename __CFA_select_get_type( typename __CFA_t ) 102 102 103 103 104 //============================================================================================= … … 211 212 bool unregister_select( select_timeout_node & this, select_node & node ); 212 213 bool on_selected( select_timeout_node & this, select_node & node ); 214 select_timeout_node __CFA_select_get_type( select_timeout_node this ); 213 215 214 216 // Gateway routines to waituntil on duration 215 217 select_timeout_node timeout( Duration duration ); 216 218 select_timeout_node sleep( Duration duration ); 219
Note: See TracChangeset
for help on using the changeset viewer.