Changeset 29e1582
- Timestamp:
- Jul 5, 2026, 11:31:08 PM (4 days ago)
- Branches:
- master
- Children:
- 0244ab6
- Parents:
- f9e61c1
- File:
-
- 1 edited
-
tests/concurrency/lockfree_stack.cfa (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/concurrency/lockfree_stack.cfa
rf9e61c1 r29e1582 10 10 // Created On : Thu May 25 15:36:50 2023 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Jun 9 14:01:07 202313 // Update Count : 6812 // Last Modified On : Sat Jul 4 15:59:49 2026 13 // Update Count : 74 14 14 // 15 15 16 16 #include <thread.hfa> 17 #include < atomic.hfa> // CASV17 #include <bits/atomic.hfa> // AtomicCasv 18 18 #include <fstream.hfa> 19 19 … … 43 43 for () { // busy wait 44 44 Link temp{ { &n, n.next.count + 1 } }; 45 if ( CASV( s.stack.atom, n.next.atom, temp.atom ) ) break; // attempt to update top node45 if ( AtomicCasv( s.stack.atom, n.next.atom, temp.atom ) ) break; // attempt to update top node 46 46 } 47 47 } … … 52 52 if ( t.top == NULL ) return NULL; // empty stack ? 53 53 Link temp{ { t.top->next.top, t.count } }; 54 if ( CASV( stack.atom, t.atom, temp.atom ) ) return t.top; // attempt to update top node54 if ( AtomicCasv( stack.atom, t.atom, temp.atom ) ) return t.top; // attempt to update top node 55 55 } 56 56 }
Note:
See TracChangeset
for help on using the changeset viewer.