Commit 5c0c0f95 by Danila Klimenko

The "expected" value is now atomically returned from "AtomicBase<>::CompareAndSwap".

parent 7c313f90
...@@ -177,8 +177,7 @@ CompareAndSwap(BaseType& expected, BaseType desired) { ...@@ -177,8 +177,7 @@ CompareAndSwap(BaseType& expected, BaseType desired) {
compare_and_swap(&AtomicValue, &native_expected, native_desired)) !=0 compare_and_swap(&AtomicValue, &native_expected, native_desired)) !=0
? true : false; ? true : false;
if (!return_val) memcpy(&expected, &native_expected, sizeof(expected));
expected = Load();
return return_val; return return_val;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment