Changeset 314dab6 for libcfa/src/containers
- Timestamp:
- May 18, 2020, 4:40:10 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:
- 7c38d53
- Parents:
- 893da07
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/containers/stackLockFree.hfa
r893da07 r314dab6 9 9 // Created On : Wed May 13 20:58:58 2020 10 10 // Last Modified By : Peter A. Buhr 11 // Last Modified On : Sun May 17 20:53:37202012 // Update Count : 4811 // Last Modified On : Mon May 18 13:30:08 2020 12 // Update Count : 55 13 13 // 14 14 … … 23 23 uintptr_t count; // count each push 24 24 }; 25 #if _ GLIBCXX_USE_INT128 == 125 #if __SIZEOF_INT128__ == 16 26 26 __int128 // gcc, 128-bit integer 27 27 #else 28 28 uint64_t // 64-bit integer 29 #endif // _ GLIBCXX_USE_INT128 == 129 #endif // __SIZEOF_INT128__ == 16 30 30 atom; 31 31 }; // Link … … 44 44 for () { // busy wait 45 45 *getNext( &n ) = stack; // atomic assignment unnecessary, or use CAA 46 46 if ( __atomic_compare_exchange_n( &stack.atom, &getNext( &n )->atom, (Link(T))@{ {&n, getNext( &n )->count + 1} }.atom, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST ) ) break; // attempt to update top node 47 47 } // for 48 48 } // push
Note:
See TracChangeset
for help on using the changeset viewer.