Chromium Code Reviews| Index: base/threading/worker_pool_posix.cc |
| diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc |
| index dcebe0ab7d2fb704d118a6f797a272ef6c1c0aeb..40faeb692eb25678dee00a739c2481453edad0c7 100644 |
| --- a/base/threading/worker_pool_posix.cc |
| +++ b/base/threading/worker_pool_posix.cc |
| @@ -150,8 +150,8 @@ void PosixDynamicThreadPool::AddTask(PendingTask* pending_task) { |
| DCHECK(!terminated_) |
| << "This thread pool is already terminated. Do not post new tasks."; |
| - pending_tasks_.push(*pending_task); |
| - pending_task->task.Reset(); |
| + pending_tasks_.push(std::move(*pending_task)); |
| + DCHECK(pending_task->task.is_null()); |
|
Sami
2016/04/13 11:33:00
Ditto.
tzik
2016/04/13 14:35:37
Done.
|
| // We have enough worker threads. |
| if (static_cast<size_t>(num_idle_threads_) >= pending_tasks_.size()) { |
| @@ -186,7 +186,7 @@ PendingTask PosixDynamicThreadPool::WaitForTask() { |
| } |
| } |
| - PendingTask pending_task = pending_tasks_.front(); |
| + PendingTask pending_task = std::move(pending_tasks_.front()); |
| pending_tasks_.pop(); |
| return pending_task; |
| } |