| Index: webrtc/system_wrappers/interface/ref_count.h
|
| diff --git a/webrtc/system_wrappers/interface/ref_count.h b/webrtc/system_wrappers/interface/ref_count.h
|
| index 68616662e906a1c96095e5d401047bbfb84bd317..7ff963dd1abf06d1b4cee1c37cc8421e3c39e2b6 100644
|
| --- a/webrtc/system_wrappers/interface/ref_count.h
|
| +++ b/webrtc/system_wrappers/interface/ref_count.h
|
| @@ -11,7 +11,7 @@
|
| #ifndef SYSTEM_WRAPPERS_INTERFACE_REF_COUNT_H_
|
| #define SYSTEM_WRAPPERS_INTERFACE_REF_COUNT_H_
|
|
|
| -#include "webrtc/system_wrappers/interface/atomic32.h"
|
| +#include "webrtc/base/atomicops.h"
|
|
|
| namespace webrtc {
|
|
|
| @@ -61,20 +61,18 @@ class RefCountImpl : public T {
|
| RefCountImpl(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
|
| : T(p1, p2, p3, p4, p5), ref_count_(0) {}
|
|
|
| - virtual int32_t AddRef() {
|
| - return ++ref_count_;
|
| - }
|
| + virtual int32_t AddRef() { return rtc::AtomicOps::Increment(&ref_count_); }
|
|
|
| virtual int32_t Release() {
|
| int32_t ref_count;
|
| - ref_count = --ref_count_;
|
| + ref_count = rtc::AtomicOps::Decrement(&ref_count_);
|
| if (ref_count == 0)
|
| delete this;
|
| return ref_count;
|
| }
|
|
|
| protected:
|
| - Atomic32 ref_count_;
|
| + volatile int ref_count_;
|
| };
|
|
|
| } // namespace webrtc
|
|
|