Revert of Make the default ctor of rtc::Thread, protected (patchset #3 id:40001 of https://codereview.webrtc.org/2981623002/ )

Reason for revert:
Break projects.

Original issue's description:
> Make the default ctor of rtc::Thread, protected.
> The goal is to force use of Thread::Create or Thread::CreateWithSocketServer.
>
> The default constructor constructs a 'default' socket server, which is usually a 'physical' socket server, but not always. Not every instance of Thread actually needs to have network support, so it's better to have this be explicit instead of unknowingly instantiate one.
>
> BUG=none
>
> Review-Url: https://codereview.webrtc.org/2981623002
> Cr-Commit-Position: refs/heads/master@{#19001}
> Committed: a8a3515997

TBR=kthelgason@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=none

Review-Url: https://codereview.webrtc.org/2979963002
Cr-Commit-Position: refs/heads/master@{#19003}
This commit is contained in:
charujain
2017-07-13 07:06:39 -07:00
committed by Commit Bot
parent a5f1de1e65
commit a117b04113
16 changed files with 142 additions and 150 deletions

View File

@ -349,8 +349,8 @@ TEST(FakeClock, SettingTimeWakesThreads) {
FakeClock clock;
SetClockForTesting(&clock);
std::unique_ptr<Thread> worker(Thread::CreateWithSocketServer());
worker->Start();
Thread worker;
worker.Start();
// Post an event that won't be executed for 10 seconds.
Event message_handler_dispatched(false, false);
@ -358,7 +358,7 @@ TEST(FakeClock, SettingTimeWakesThreads) {
message_handler_dispatched.Set();
};
FunctorMessageHandler<void, decltype(functor)> handler(functor);
worker->PostDelayed(RTC_FROM_HERE, 60000, &handler);
worker.PostDelayed(RTC_FROM_HERE, 60000, &handler);
// Wait for a bit for the worker thread to be started and enter its socket
// select(). Otherwise this test would be trivial since the worker thread
@ -369,7 +369,7 @@ TEST(FakeClock, SettingTimeWakesThreads) {
// and dispatch the message instantly.
clock.AdvanceTime(TimeDelta::FromSeconds(60u));
EXPECT_TRUE(message_handler_dispatched.Wait(0));
worker->Stop();
worker.Stop();
SetClockForTesting(nullptr);