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

Unified Diff: webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h

Issue 1347793005: Replace Atomic32 with webrtc/base/atomicops.h. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: fix typo Created 5 years, 3 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
Index: webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h
diff --git a/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h b/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h
index 11397c1c597ab9bde4a5633a25dd9994534d244a..fdf66ad04d329598936cac9f0db621f997eed500 100644
--- a/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h
+++ b/webrtc/voice_engine/test/auto_test/fixtures/after_initialization_fixture.h
@@ -13,10 +13,10 @@
#include <deque>
+#include "webrtc/base/atomicops.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
-#include "webrtc/system_wrappers/interface/atomic32.h"
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
#include "webrtc/system_wrappers/interface/event_wrapper.h"
#include "webrtc/system_wrappers/interface/sleep.h"
@@ -55,8 +55,9 @@ class LoopBackTransport : public webrtc::Transport {
enum {
kSleepIntervalMs = 10
};
- int32_t limit = transmitted_packets_.Value() + packet_count;
- while (transmitted_packets_.Value() < limit) {
+ int32_t limit =
+ rtc::AtomicOps::AcquireLoad(&transmitted_packets_) + packet_count;
+ while (rtc::AtomicOps::AcquireLoad(&transmitted_packets_) < limit) {
webrtc::SleepMs(kSleepIntervalMs);
}
}
@@ -138,7 +139,7 @@ class LoopBackTransport : public webrtc::Transport {
voe_network_->ReceivedRTCPPacket(channel, p.data, p.len);
break;
}
- ++transmitted_packets_;
+ rtc::AtomicOps::Increment(&transmitted_packets_);
}
return true;
}
@@ -150,7 +151,7 @@ class LoopBackTransport : public webrtc::Transport {
const int channel_;
std::map<uint32_t, int> channels_ GUARDED_BY(crit_.get());
webrtc::VoENetwork* const voe_network_;
- webrtc::Atomic32 transmitted_packets_;
+ volatile int transmitted_packets_;
};
// This fixture initializes the voice engine in addition to the work

Powered by Google App Engine
This is Rietveld 408576698