Changeset 6b33e89 for libcfa/src/concurrency/future.hfa
- Timestamp:
- Apr 25, 2025, 7:39:09 AM (5 months ago)
- Branches:
- master
- Children:
- 65bd3c2
- Parents:
- b195498
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/future.hfa
rb195498 r6b33e89 10 10 // Created On : Wed Jan 06 17:33:18 2021 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Sun Mar 2 14:45:56202513 // Update Count : 1912 // Last Modified On : Wed Apr 23 22:41:10 2025 13 // Update Count : 22 14 14 // 15 15 … … 63 63 void reset( future(T) & this ) with(this) { 64 64 lock( lock ); 65 if ( ! waiters`isEmpty)65 if ( ! isEmpty( waiters ) ) 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 = ! waiters`isEmpty;84 bool ret_val = ! isEmpty( waiters ); 85 85 state = FUTURE_FULFILLED; 86 while ( ! waiters`isEmpty) {86 while ( ! isEmpty( waiters ) ) { 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 = try_pop_front( waiters );89 select_node &s = remove_first( 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 ( ! s`isListed) return false;211 lock( lock ); 212 if ( s`isListed) remove( s );210 if ( ! isListed( s ) ) return false; 211 lock( lock ); 212 if ( isListed( s ) ) remove( s ); 213 213 unlock( lock ); 214 214 return false;
Note:
See TracChangeset
for help on using the changeset viewer.