- File:
-
- 1 edited
-
libcfa/src/concurrency/future.hfa (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/future.hfa
r6b33e89 r3483185 10 10 // Created On : Wed Jan 06 17:33:18 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Apr 23 22:41:10202513 // Update Count : 2212 // Last Modified On : Sun Mar 2 14:45:56 2025 13 // Update Count : 19 14 14 // 15 15 … … 63 63 void reset( future(T) & this ) with(this) { 64 64 lock( lock ); 65 if ( ! isEmpty( waiters ))65 if ( ! waiters`isEmpty ) 66 66 abort("Attempting to reset a future with blocked waiters"); 67 67 state = FUTURE_EMPTY; … … 82 82 83 83 bool fulfil$( future(T) & this ) with(this) { // helper 84 bool ret_val = ! isEmpty( waiters );84 bool ret_val = ! waiters`isEmpty; 85 85 state = FUTURE_FULFILLED; 86 while ( ! isEmpty( waiters )) {86 while ( ! waiters`isEmpty ) { 87 87 if ( !__handle_waituntil_OR( waiters ) ) // handle special waituntil OR case 88 88 break; // if handle_OR returns false then waiters is empty so break 89 select_node &s = remove_first( waiters );89 select_node &s = try_pop_front( waiters ); 90 90 91 91 if ( s.clause_status == 0p ) // poke in result so that woken threads do not need to reacquire any locks … … 208 208 209 209 bool unregister_select( future(T) & this, select_node & s ) with(this) { 210 if ( ! isListed( s )) return false;211 lock( lock ); 212 if ( isListed( s )) remove( s );210 if ( ! s`isListed ) return false; 211 lock( lock ); 212 if ( s`isListed ) remove( s ); 213 213 unlock( lock ); 214 214 return false;
Note:
See TracChangeset
for help on using the changeset viewer.