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