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:
@ -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());
|
||||
|
||||
Reference in New Issue
Block a user