Created
November 28, 2016 10:59
-
-
Save topecongiro/0776bb6b2fada7854af62209953b6f90 to your computer and use it in GitHub Desktop.
Double-width compare-and-swap implementation without asm such as CMPXCHG16B.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using u128_t = usigned __int128; | |
bool dwcas(u128_t* ptr, u128_t oldval, u128_t newval) { | |
return __sync_bool_compare_and_swap(ptr, oldval, newval); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment