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}
This commit is contained in:
tommi
2017-07-13 05:47:25 -07:00
committed by Commit Bot
parent abcf112ae0
commit a8a3515997
16 changed files with 150 additions and 142 deletions

View File

@ -681,7 +681,7 @@ void SocketTest::SocketServerWaitInternal(const IPAddress& loopback) {
EXPECT_FALSE(sink.Check(accepted.get(), SSE_READ));
// Shouldn't signal when blocked in a thread Send, where process_io is false.
std::unique_ptr<Thread> thread(new Thread());
std::unique_ptr<Thread> thread(Thread::CreateWithSocketServer());
thread->Start();
Sleeper sleeper;
TypedMessageData<AsyncSocket*> data(client.get());