Index: base/threading/worker_pool_posix.cc |
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc |
index 917565d7269a333e6cabdfe09a6971a6ac36faf1..09b60fff5c5b9e7ee5b15da79f13205180b9b3f8 100644 |
--- a/base/threading/worker_pool_posix.cc |
+++ b/base/threading/worker_pool_posix.cc |
@@ -9,7 +9,7 @@ |
#include "base/lazy_instance.h" |
#include "base/logging.h" |
#include "base/memory/ref_counted.h" |
-#include "base/stringprintf.h" |
+#include "base/string_number_conversions.h" |
#include "base/task.h" |
#include "base/threading/platform_thread.h" |
#include "base/threading/worker_pool.h" |
@@ -63,22 +63,23 @@ class WorkerThread : public PlatformThread::Delegate { |
public: |
WorkerThread(const std::string& name_prefix, |
base::PosixDynamicThreadPool* pool) |
- : name_prefix_(name_prefix), |
+ : name_(name_prefix), |
pool_(pool) {} |
virtual void ThreadMain(); |
private: |
- const std::string name_prefix_; |
+ std::string name_; |
scoped_refptr<base::PosixDynamicThreadPool> pool_; |
DISALLOW_COPY_AND_ASSIGN(WorkerThread); |
}; |
void WorkerThread::ThreadMain() { |
- const std::string name = base::StringPrintf( |
- "%s/%d", name_prefix_.c_str(), PlatformThread::CurrentId()); |
- PlatformThread::SetName(name.c_str()); |
+ name_.reserve(name_.size() + 10); |
jar (doing other things)
2011/11/04 15:30:32
nit: Reserve is not needed.
joth
2011/11/04 16:41:25
will remove
|
+ name_.push_back('/'); |
+ name_.append(IntToString(PlatformThread::CurrentId())); |
+ PlatformThread::SetName(name_.c_str()); |
for (;;) { |
PosixDynamicThreadPool::PendingTask pending_task = pool_->WaitForTask(); |