Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: webrtc/base/refcount.h

Issue 1246073002: Implement store as an explicit atomic operation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: s/Increment/ReleaseStore Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/atomicops.h ('k') | webrtc/system_wrappers/source/trace_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/refcount.h
diff --git a/webrtc/base/refcount.h b/webrtc/base/refcount.h
index 79b0591b2b1e200942deb3f1760b06ca03012623..49f3777beabf6bd87a0c1dc78e1fe553998d286f 100644
--- a/webrtc/base/refcount.h
+++ b/webrtc/base/refcount.h
@@ -96,11 +96,11 @@ class RefCountedObject : public T {
}
virtual int AddRef() {
- return rtc::AtomicOps::Increment(&ref_count_);
+ return AtomicOps::Increment(&ref_count_);
}
virtual int Release() {
- int count = rtc::AtomicOps::Decrement(&ref_count_);
+ int count = AtomicOps::Decrement(&ref_count_);
if (!count) {
delete this;
}
@@ -114,7 +114,7 @@ class RefCountedObject : public T {
// barrier needed for the owning thread to act on the object, knowing that it
// has exclusive access to the object.
virtual bool HasOneRef() const {
- return rtc::AtomicOps::Load(&ref_count_) == 1;
+ return AtomicOps::AcquireLoad(&ref_count_) == 1;
}
protected:
« no previous file with comments | « webrtc/base/atomicops.h ('k') | webrtc/system_wrappers/source/trace_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698