Index: src/base/atomic-utils.h |
diff --git a/src/base/atomic-utils.h b/src/base/atomic-utils.h |
index 7931c7376ab4b5ba4bf27268bbeb124fec6acef8..fd9b1b502d573ea62a66c78f3e5daa7c2a27e2f8 100644 |
--- a/src/base/atomic-utils.h |
+++ b/src/base/atomic-utils.h |
@@ -65,6 +65,13 @@ class NoBarrierAtomicValue { |
return reinterpret_cast<base::NoBarrierAtomicValue<T>*>(address); |
} |
+ V8_INLINE bool TrySetValue(T old_value, T new_value) { |
+ return base::NoBarrier_CompareAndSwap( |
+ &value_, cast_helper<T>::to_storage_type(old_value), |
+ cast_helper<T>::to_storage_type(new_value)) == |
+ cast_helper<T>::to_storage_type(old_value); |
+ } |
+ |
V8_INLINE T Value() const { |
return cast_helper<T>::to_return_type(base::NoBarrier_Load(&value_)); |
} |