- File:
-
- 1 edited
-
libcfa/src/concurrency/locks.hfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.hfa
rfd365da r76a798d 478 478 #endif 479 479 lock( lock, node ); 480 while(__atomic_load_n(&held, __ATOMIC_SEQ_CST)) Pause(); 481 __atomic_store_n(&held, true, __ATOMIC_SEQ_CST); 480 while(held) Pause(); 481 held = true; 482 // printf("locked\n"); 482 483 unlock( lock, node ); 483 484 #ifdef __CFA_DEBUG__ … … 487 488 488 489 static inline void unlock(spin_queue_lock & this) with(this) { 490 // printf("unlocked\n"); 489 491 #ifdef __CFA_DEBUG__ 490 492 owner = 0p; 491 493 #endif 492 __atomic_store_n(&held, false, __ATOMIC_RELEASE);494 held = false; 493 495 } 494 496 … … 533 535 #endif 534 536 lock( lock, node ); 535 while( __atomic_load_n(&held, __ATOMIC_SEQ_CST)) Pause();536 __atomic_store_n(&held, true, __ATOMIC_SEQ_CST);537 while(held) Pause(); 538 held = true; 537 539 unlock( lock, node ); 538 540 #ifdef __CFA_DEBUG__ … … 545 547 owner = 0p; 546 548 #endif 547 __atomic_store_n(&held, false, __ATOMIC_SEQ_CST);549 held = false; 548 550 } 549 551 … … 586 588 #endif 587 589 lock( lock ); 588 while( __atomic_load_n(&held, __ATOMIC_SEQ_CST)) Pause();589 __atomic_store_n(&held, true, __ATOMIC_RELEASE);590 while(held) Pause(); 591 held = true; 590 592 unlock( lock ); 591 593 #ifdef __CFA_DEBUG__ … … 598 600 owner = 0p; 599 601 #endif 600 __atomic_store_n(&held, false, __ATOMIC_RELEASE);602 held = false; 601 603 } 602 604
Note:
See TracChangeset
for help on using the changeset viewer.