Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(359)

Unified Diff: webrtc/test/channel_transport/udp_socket_manager_posix.cc

Issue 1476453002: Clean up PlatformThread. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: IsRunning DCHECK Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/channel_transport/udp_socket_manager_posix.h ('k') | webrtc/test/direct_transport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/channel_transport/udp_socket_manager_posix.cc
diff --git a/webrtc/test/channel_transport/udp_socket_manager_posix.cc b/webrtc/test/channel_transport/udp_socket_manager_posix.cc
index 6b597e761c5b977d07d7ab33b41b1e61aa728c1d..6b1a466bf2671e5d2691f3f2bdecaf9beec0dbdb 100644
--- a/webrtc/test/channel_transport/udp_socket_manager_posix.cc
+++ b/webrtc/test/channel_transport/udp_socket_manager_posix.cc
@@ -184,12 +184,11 @@ bool UdpSocketManagerPosix::RemoveSocket(UdpSocketWrapper* s)
return retVal;
}
-
UdpSocketManagerPosixImpl::UdpSocketManagerPosixImpl()
-{
- _critSectList = CriticalSectionWrapper::CreateCriticalSection();
- _thread = PlatformThread::CreateThread(UdpSocketManagerPosixImpl::Run, this,
- "UdpSocketManagerPosixImplThread");
+ : _thread(UdpSocketManagerPosixImpl::Run,
+ this,
+ "UdpSocketManagerPosixImplThread"),
+ _critSectList(CriticalSectionWrapper::CreateCriticalSection()) {
FD_ZERO(&_readFds);
WEBRTC_TRACE(kTraceMemory, kTraceTransport, -1,
"UdpSocketManagerPosix created");
@@ -220,29 +219,19 @@ UdpSocketManagerPosixImpl::~UdpSocketManagerPosixImpl()
bool UdpSocketManagerPosixImpl::Start()
{
- if (!_thread)
- {
- return false;
- }
-
WEBRTC_TRACE(kTraceStateInfo, kTraceTransport, -1,
"Start UdpSocketManagerPosix");
- if (!_thread->Start())
- return false;
- _thread->SetPriority(kRealtimePriority);
+ _thread.Start();
+ _thread.SetPriority(rtc::kRealtimePriority);
return true;
}
bool UdpSocketManagerPosixImpl::Stop()
{
- if (!_thread)
- {
- return true;
- }
-
WEBRTC_TRACE(kTraceStateInfo, kTraceTransport, -1,
"Stop UdpSocketManagerPosix");
- return _thread->Stop();
+ _thread.Stop();
+ return true;
}
bool UdpSocketManagerPosixImpl::Process()
« no previous file with comments | « webrtc/test/channel_transport/udp_socket_manager_posix.h ('k') | webrtc/test/direct_transport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698