Changes in libcfa/src/bits/locks.hfa [a7aea7d:6d1790c]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/locks.hfa
ra7aea7d r6d1790c 283 283 void ^?{}(future_t &) {} 284 284 285 void reset(future_t & this) {286 // needs to be in 0p or 1p287 __atomic_exchange_n( &this.ptr, 0p, __ATOMIC_SEQ_CST);288 }289 290 285 // check if the future is available 291 286 bool available( future_t & this ) { … … 345 340 346 341 // Mark the future as abandoned, meaning it will be deleted by the server 347 bool abandon( future_t & this ) { 348 /* paranoid */ verify( this.ptr != 3p ); 349 350 // Mark the future as abandonned 342 void abandon( future_t & this ) { 351 343 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 it354 if( got == 0p ) return false;355 344 356 345 // got == 2p: the future is ready but the context hasn't fully been consumed … … 358 347 if( got == 2p ) { 359 348 while( this.ptr != 1p ) Pause(); 360 got = 1p; 361 } 362 363 // The future is completed delete it now 364 /* paranoid */ verify( this.ptr != 1p ); 365 free( &this ); 366 return true; 349 } 350 return; 367 351 } 368 352
Note: See TracChangeset
for help on using the changeset viewer.