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

Unified Diff: webrtc/system_wrappers/source/critical_section_unittest.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years, 1 month 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/system_wrappers/source/critical_section_unittest.cc
diff --git a/webrtc/system_wrappers/source/critical_section_unittest.cc b/webrtc/system_wrappers/source/critical_section_unittest.cc
index 347cb55c91ae21013d7cce2243fd3aaf2605abb5..9abf8b8017e6ad38d93ac406a379d2c5832d6995 100644
--- a/webrtc/system_wrappers/source/critical_section_unittest.cc
+++ b/webrtc/system_wrappers/source/critical_section_unittest.cc
@@ -78,10 +78,10 @@ TEST_F(CritSectTest, ThreadWakesOnce) NO_THREAD_SAFETY_ANALYSIS {
CriticalSectionWrapper* crit_sect =
CriticalSectionWrapper::CreateCriticalSection();
ProtectedCount count(crit_sect);
- rtc::scoped_ptr<PlatformThread> thread = PlatformThread::CreateThread(
+ rtc::PlatformThread thread(
&LockUnlockThenStopRunFunction, &count, "ThreadWakesOnce");
crit_sect->Enter();
- ASSERT_TRUE(thread->Start());
+ thread.Start();
SwitchProcess();
// The critical section is of reentrant mode, so this should not release
// the lock, even though count.Count() locks and unlocks the critical section
@@ -90,7 +90,7 @@ TEST_F(CritSectTest, ThreadWakesOnce) NO_THREAD_SAFETY_ANALYSIS {
ASSERT_EQ(0, count.Count());
crit_sect->Leave(); // This frees the thread to act.
EXPECT_TRUE(WaitForCount(1, &count));
- EXPECT_TRUE(thread->Stop());
+ thread.Stop();
delete crit_sect;
}
@@ -105,10 +105,10 @@ TEST_F(CritSectTest, ThreadWakesTwice) NO_THREAD_SAFETY_ANALYSIS {
CriticalSectionWrapper* crit_sect =
CriticalSectionWrapper::CreateCriticalSection();
ProtectedCount count(crit_sect);
- rtc::scoped_ptr<PlatformThread> thread = PlatformThread::CreateThread(
+ rtc::PlatformThread thread(
&LockUnlockRunFunction, &count, "ThreadWakesTwice");
crit_sect->Enter(); // Make sure counter stays 0 until we wait for it.
- ASSERT_TRUE(thread->Start());
+ thread.Start();
crit_sect->Leave();
// The thread is capable of grabbing the lock multiple times,
@@ -128,7 +128,7 @@ TEST_F(CritSectTest, ThreadWakesTwice) NO_THREAD_SAFETY_ANALYSIS {
SwitchProcess();
EXPECT_TRUE(WaitForCount(count_before + 1, &count));
- EXPECT_TRUE(thread->Stop());
+ thread.Stop();
delete crit_sect;
}
« no previous file with comments | « webrtc/system_wrappers/source/condition_variable_unittest.cc ('k') | webrtc/system_wrappers/source/data_log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698