Chromium Code Reviews| Index: webrtc/base/thread.cc |
| diff --git a/webrtc/base/thread.cc b/webrtc/base/thread.cc |
| index 9a71c1aa3fd352130677641d54b2ff8a79ce5d96..471460987aed87e44964de1867ccad669c2e1889 100644 |
| --- a/webrtc/base/thread.cc |
| +++ b/webrtc/base/thread.cc |
| @@ -528,4 +528,15 @@ AutoThread::~AutoThread() { |
| } |
| } |
| +AutoSocketServerThread::AutoSocketServerThread(SocketServer* ss) |
| + : Thread(ss) { |
| + old_thread_ = ThreadManager::Instance()->CurrentThread(); |
|
Taylor Brandstetter
2017/04/28 02:59:34
Does it need to do this? Or can it do "DCHECK(!Cur
nisse-webrtc
2017/04/28 09:46:52
PhysicalSocketTest is part of the webrtc_nonparall
Taylor Brandstetter
2017/04/28 16:59:45
I wasn't thinking when I left this comment; I was
|
| + rtc::ThreadManager::Instance()->SetCurrentThread(this); |
| +} |
| + |
| +AutoSocketServerThread::~AutoSocketServerThread() { |
| + RTC_DCHECK(ThreadManager::Instance()->CurrentThread() == this); |
| + rtc::ThreadManager::Instance()->SetCurrentThread(old_thread_); |
| +} |
| + |
| } // namespace rtc |