Changeset 9019b14
- Timestamp:
- Jun 14, 2020, 3:00:31 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 016b1eb, fb19194
- Parents:
- 79aae15
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified libcfa/src/containers/stackLockFree.hfa ¶
r79aae15 r9019b14 9 9 // Created On : Wed May 13 20:58:58 2020 10 10 // Last Modified By : Peter A. Buhr 11 // Last Modified On : S at Jun 13 12:24:37202012 // Update Count : 6 211 // Last Modified On : Sun Jun 14 13:25:09 2020 12 // Update Count : 64 13 13 // 14 14 … … 20 20 union Link { 21 21 struct { // 32/64-bit x 2 22 T * top;// pointer to stack top22 T * volatile top; // pointer to stack top 23 23 uintptr_t count; // count each push 24 24 }; … … 49 49 50 50 T * pop( StackLF(T) & this ) with(this) { 51 Link(T) t @= {}; 52 t = stack; // atomic assignment unnecessary, or use CAA 51 Link(T) t @= stack; // atomic assignment unnecessary, or use CAA 53 52 for () { // busy wait 54 53 if ( t.top == 0p ) return 0p; // empty stack ?
Note: See TracChangeset
for help on using the changeset viewer.