Add a name to the ProcessThread constructor.
Helps differentiate between different instances when debugging.
Review URL: https://codereview.webrtc.org/1337003003
Cr-Commit-Position: refs/heads/master@{#9927}
diff --git a/webrtc/modules/utility/source/process_thread_impl.cc b/webrtc/modules/utility/source/process_thread_impl.cc
index 947fdb0..eab0d9a 100644
--- a/webrtc/modules/utility/source/process_thread_impl.cc
+++ b/webrtc/modules/utility/source/process_thread_impl.cc
@@ -36,13 +36,16 @@
ProcessThread::~ProcessThread() {}
// static
-rtc::scoped_ptr<ProcessThread> ProcessThread::Create() {
- return rtc::scoped_ptr<ProcessThread>(new ProcessThreadImpl()).Pass();
+rtc::scoped_ptr<ProcessThread> ProcessThread::Create(
+ const char* thread_name) {
+ return rtc::scoped_ptr<ProcessThread>(new ProcessThreadImpl(thread_name))
+ .Pass();
}
-ProcessThreadImpl::ProcessThreadImpl()
- : wake_up_(EventWrapper::Create()), stop_(false) {
-}
+ProcessThreadImpl::ProcessThreadImpl(const char* thread_name)
+ : wake_up_(EventWrapper::Create()),
+ stop_(false),
+ thread_name_(thread_name) {}
ProcessThreadImpl::~ProcessThreadImpl() {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -73,8 +76,8 @@
m.module->ProcessThreadAttached(this);
}
- thread_ = ThreadWrapper::CreateThread(
- &ProcessThreadImpl::Run, this, "ProcessThread");
+ thread_ = ThreadWrapper::CreateThread(&ProcessThreadImpl::Run, this,
+ thread_name_.c_str());
CHECK(thread_->Start());
}