Index: webrtc/base/refcount.h |
diff --git a/webrtc/base/refcount.h b/webrtc/base/refcount.h |
index 55ce23a348b68a84ce362d98f85c0f871725303a..550a7122ae2fe9c2f6c22d4ad506cd329c59596f 100644 |
--- a/webrtc/base/refcount.h |
+++ b/webrtc/base/refcount.h |
@@ -107,15 +107,20 @@ class RefCountedObject : public T { |
return count; |
} |
+ // This call returns the reference count, and performs the memory |
+ // barrier needed for the owning thread to act on the object, in |
+ // case the value of the reference count implies exclusive access to |
+ // the object. |
+ virtual int GetRefCount() const { |
pbos-webrtc
2016/05/20 13:32:21
I think this method should also be going away, so
nisse-webrtc
2016/05/23 07:35:06
I can add a TODO like "Currently used only for I42
|
+ return AtomicOps::AcquireLoad(&ref_count_); |
+ } |
// Return whether the reference count is one. If the reference count is used |
// in the conventional way, a reference count of 1 implies that the current |
// thread owns the reference and no other thread shares it. This call |
// performs the test for a reference count of one, and performs the memory |
// 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 AtomicOps::AcquireLoad(&ref_count_) == 1; |
- } |
+ virtual bool HasOneRef() const { return GetRefCount() == 1; } |
protected: |
virtual ~RefCountedObject() { |