Clean up PlatformThread.

* Move PlatformThread to rtc::.
* Remove ::CreateThread factory method.
* Make non-scoped_ptr from a lot of invocations.
* Make Start/Stop void.
* Remove rtc::Thread priorities, which were unused and would collide.
* Add ::IsRunning() to PlatformThread.

BUG=
R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1476453002 .

Cr-Commit-Position: refs/heads/master@{#10812}
This commit is contained in:
Peter Boström
2015-11-26 17:45:47 +01:00
parent ad113e50d2
commit 8c38e8b9b9
74 changed files with 374 additions and 1052 deletions

View File

@ -252,33 +252,6 @@ TEST(ThreadTest, Names) {
delete thread;
}
// Test that setting thread priorities doesn't cause a malfunction.
// There's no easy way to verify the priority was set properly at this time.
TEST(ThreadTest, Priorities) {
Thread *thread;
thread = new Thread();
EXPECT_TRUE(thread->SetPriority(PRIORITY_HIGH));
EXPECT_TRUE(thread->Start());
thread->Stop();
delete thread;
thread = new Thread();
EXPECT_TRUE(thread->SetPriority(PRIORITY_ABOVE_NORMAL));
EXPECT_TRUE(thread->Start());
thread->Stop();
delete thread;
thread = new Thread();
EXPECT_TRUE(thread->Start());
#if defined(WEBRTC_WIN)
EXPECT_TRUE(thread->SetPriority(PRIORITY_ABOVE_NORMAL));
#else
EXPECT_FALSE(thread->SetPriority(PRIORITY_ABOVE_NORMAL));
#endif
thread->Stop();
delete thread;
}
TEST(ThreadTest, Wrap) {
Thread* current_thread = Thread::Current();
current_thread->UnwrapCurrent();