Changeset a7aea7d
- Timestamp:
- Jan 7, 2021, 1:17:47 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 44e37ef
- Parents:
- 2fc9664b
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/locks.hfa
r2fc9664b ra7aea7d 345 345 346 346 // Mark the future as abandoned, meaning it will be deleted by the server 347 void abandon( future_t & this ) { 347 bool abandon( future_t & this ) { 348 /* paranoid */ verify( this.ptr != 3p ); 349 350 // Mark the future as abandonned 348 351 struct oneshot * got = __atomic_exchange_n( &this.ptr, 3p, __ATOMIC_SEQ_CST); 352 353 // If the future isn't already fulfilled, let the server delete it 354 if( got == 0p ) return false; 349 355 350 356 // got == 2p: the future is ready but the context hasn't fully been consumed … … 352 358 if( got == 2p ) { 353 359 while( this.ptr != 1p ) Pause(); 354 } 355 360 got = 1p; 361 } 362 363 // The future is completed delete it now 364 /* paranoid */ verify( this.ptr != 1p ); 356 365 free( &this ); 357 return ;366 return true; 358 367 } 359 368
Note: See TracChangeset
for help on using the changeset viewer.