Index: webrtc/video_engine/payload_router.h |
diff --git a/webrtc/video_engine/payload_router.h b/webrtc/video_engine/payload_router.h |
index 0d6a1ac6dde48709aa8aaf2df37c7b11b64135bc..6909833cdb3ff1a38b73e3b4351f90cb5062207a 100644 |
--- a/webrtc/video_engine/payload_router.h |
+++ b/webrtc/video_engine/payload_router.h |
@@ -14,11 +14,11 @@ |
#include <list> |
#include <vector> |
+#include "webrtc/base/atomicops.h" |
#include "webrtc/base/constructormagic.h" |
#include "webrtc/base/scoped_ptr.h" |
#include "webrtc/base/thread_annotations.h" |
#include "webrtc/common_types.h" |
-#include "webrtc/system_wrappers/interface/atomic32.h" |
namespace webrtc { |
@@ -63,8 +63,12 @@ class PayloadRouter { |
// and RTP headers. |
size_t MaxPayloadLength() const; |
- void AddRef() { ++ref_count_; } |
- void Release() { if (--ref_count_ == 0) { delete this; } } |
+ void AddRef() { rtc::AtomicOps::Increment(&ref_count_); } |
+ void Release() { |
+ if (rtc::AtomicOps::Decrement(&ref_count_) == 0) { |
+ delete this; |
+ } |
+ } |
private: |
// TODO(mflodman): When the new video API has launched, remove crit_ and |
@@ -75,7 +79,7 @@ class PayloadRouter { |
std::vector<RtpRtcp*> rtp_modules_ GUARDED_BY(crit_.get()); |
bool active_ GUARDED_BY(crit_.get()); |
- Atomic32 ref_count_; |
+ volatile int ref_count_; |
RTC_DISALLOW_COPY_AND_ASSIGN(PayloadRouter); |
}; |