Changeset ffec1bf for libcfa/src/concurrency/locks.hfa
- Timestamp:
- Jul 25, 2022, 2:23:28 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 4c48be0, 5cf1228, def751f
- Parents:
- 9e23b446 (diff), 1f950c3b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/locks.hfa
r9e23b446 rffec1bf 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.