Replace the stop_event_ in PlatformThread with an atomic flag

BUG=webrtc:7187

Review-Url: https://codereview.webrtc.org/2708433002
Cr-Commit-Position: refs/heads/master@{#16705}
This commit is contained in:
tommi
2017-02-19 16:09:55 -08:00
committed by Commit bot
parent d95c48a810
commit 82ead60076
3 changed files with 36 additions and 20 deletions

View File

@ -85,7 +85,9 @@ TEST(ProcessThreadImpl, ProcessCall) {
std::unique_ptr<EventWrapper> event(EventWrapper::Create());
MockModule module;
EXPECT_CALL(module, TimeUntilNextProcess()).WillRepeatedly(Return(0));
EXPECT_CALL(module, TimeUntilNextProcess())
.WillOnce(Return(0))
.WillRepeatedly(Return(1));
EXPECT_CALL(module, Process())
.WillOnce(DoAll(SetEvent(event.get()), Return()))
.WillRepeatedly(Return());
@ -105,7 +107,9 @@ TEST(ProcessThreadImpl, ProcessCall2) {
std::unique_ptr<EventWrapper> event(EventWrapper::Create());
MockModule module;
EXPECT_CALL(module, TimeUntilNextProcess()).WillRepeatedly(Return(0));
EXPECT_CALL(module, TimeUntilNextProcess())
.WillOnce(Return(0))
.WillRepeatedly(Return(1));
EXPECT_CALL(module, Process())
.WillOnce(DoAll(SetEvent(event.get()), Return()))
.WillRepeatedly(Return());
@ -128,7 +132,9 @@ TEST(ProcessThreadImpl, Deregister) {
int process_count = 0;
MockModule module;
EXPECT_CALL(module, TimeUntilNextProcess()).WillRepeatedly(Return(0));
EXPECT_CALL(module, TimeUntilNextProcess())
.WillOnce(Return(0))
.WillRepeatedly(Return(1));
EXPECT_CALL(module, Process())
.WillOnce(DoAll(SetEvent(event.get()),
Increment(&process_count),