From 12411ef40e08c5e28ccde54ab3418c96676ffcbc Mon Sep 17 00:00:00 2001 From: pbos Date: Mon, 23 Nov 2015 14:47:56 -0800 Subject: Move ThreadWrapper to ProcessThread in base. Also removes all virtual methods. Permits using a thread from rtc_base_approved (namely event tracing). BUG=webrtc:5158 R=tommi@webrtc.org Review URL: https://codereview.webrtc.org/1469013002 Cr-Commit-Position: refs/heads/master@{#10760} --- webrtc/system_wrappers/source/condition_variable_unittest.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'webrtc/system_wrappers/source/condition_variable_unittest.cc') diff --git a/webrtc/system_wrappers/source/condition_variable_unittest.cc b/webrtc/system_wrappers/source/condition_variable_unittest.cc index ed845cc21e..aad55ac611 100644 --- a/webrtc/system_wrappers/source/condition_variable_unittest.cc +++ b/webrtc/system_wrappers/source/condition_variable_unittest.cc @@ -11,9 +11,9 @@ #include "webrtc/system_wrappers/include/condition_variable_wrapper.h" #include "testing/gtest/include/gtest/gtest.h" +#include "webrtc/base/platform_thread.h" #include "webrtc/base/scoped_ptr.h" #include "webrtc/system_wrappers/include/critical_section_wrapper.h" -#include "webrtc/system_wrappers/include/thread_wrapper.h" #include "webrtc/system_wrappers/include/tick_util.h" #include "webrtc/system_wrappers/include/trace.h" @@ -147,8 +147,8 @@ class CondVarTest : public ::testing::Test { CondVarTest() {} virtual void SetUp() { - thread_ = ThreadWrapper::CreateThread(&WaitingRunFunction, - &baton_, "CondVarTest"); + thread_ = PlatformThread::CreateThread(&WaitingRunFunction, &baton_, + "CondVarTest"); ASSERT_TRUE(thread_->Start()); } @@ -167,7 +167,7 @@ class CondVarTest : public ::testing::Test { Baton baton_; private: - rtc::scoped_ptr thread_; + rtc::scoped_ptr thread_; }; // The SetUp and TearDown functions use condition variables. -- cgit v1.2.3 From 8c38e8b9b96d72317d6ce94c1442113b4e385dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Bostr=C3=B6m?= Date: Thu, 26 Nov 2015 17:45:47 +0100 Subject: 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} --- webrtc/system_wrappers/source/condition_variable_unittest.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'webrtc/system_wrappers/source/condition_variable_unittest.cc') diff --git a/webrtc/system_wrappers/source/condition_variable_unittest.cc b/webrtc/system_wrappers/source/condition_variable_unittest.cc index aad55ac611..5a8dd0b36e 100644 --- a/webrtc/system_wrappers/source/condition_variable_unittest.cc +++ b/webrtc/system_wrappers/source/condition_variable_unittest.cc @@ -144,12 +144,10 @@ bool WaitingRunFunction(void* obj) { class CondVarTest : public ::testing::Test { public: - CondVarTest() {} + CondVarTest() : thread_(&WaitingRunFunction, &baton_, "CondVarTest") {} virtual void SetUp() { - thread_ = PlatformThread::CreateThread(&WaitingRunFunction, &baton_, - "CondVarTest"); - ASSERT_TRUE(thread_->Start()); + thread_.Start(); } virtual void TearDown() { @@ -160,14 +158,14 @@ class CondVarTest : public ::testing::Test { // and Pass). ASSERT_TRUE(baton_.Pass(kShortWaitMs)); ASSERT_TRUE(baton_.Grab(kShortWaitMs)); - ASSERT_TRUE(thread_->Stop()); + thread_.Stop(); } protected: Baton baton_; private: - rtc::scoped_ptr thread_; + rtc::PlatformThread thread_; }; // The SetUp and TearDown functions use condition variables. -- cgit v1.2.3