| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/threading/sequenced_worker_pool.h" | 5 #include "base/threading/sequenced_worker_pool.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 SignalHasWork(); | 770 SignalHasWork(); |
| 771 delete_these_outside_lock.clear(); | 771 delete_these_outside_lock.clear(); |
| 772 | 772 |
| 773 // Complete thread creation outside the lock if necessary. | 773 // Complete thread creation outside the lock if necessary. |
| 774 if (new_thread_id) | 774 if (new_thread_id) |
| 775 FinishStartingAdditionalThread(new_thread_id); | 775 FinishStartingAdditionalThread(new_thread_id); |
| 776 | 776 |
| 777 this_worker->set_running_task_info( | 777 this_worker->set_running_task_info( |
| 778 SequenceToken(task.sequence_token_id), task.shutdown_behavior); | 778 SequenceToken(task.sequence_token_id), task.shutdown_behavior); |
| 779 | 779 |
| 780 tracked_objects::ThreadData::PrepareForStartOfRun(task.birth_tally); | |
| 781 tracked_objects::TaskStopwatch stopwatch; | 780 tracked_objects::TaskStopwatch stopwatch; |
| 782 stopwatch.Start(); | 781 stopwatch.Start(); |
| 783 task.task.Run(); | 782 task.task.Run(); |
| 784 stopwatch.Stop(); | 783 stopwatch.Stop(); |
| 785 | 784 |
| 786 tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking( | 785 tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking( |
| 787 task, stopwatch); | 786 task, stopwatch); |
| 788 | 787 |
| 789 // Make sure our task is erased outside the lock for the | 788 // Make sure our task is erased outside the lock for the |
| 790 // same reason we do this with delete_these_oustide_lock. | 789 // same reason we do this with delete_these_oustide_lock. |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1302 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) { | 1301 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) { |
| 1303 DCHECK(constructor_message_loop_->BelongsToCurrentThread()); | 1302 DCHECK(constructor_message_loop_->BelongsToCurrentThread()); |
| 1304 inner_->Shutdown(max_new_blocking_tasks_after_shutdown); | 1303 inner_->Shutdown(max_new_blocking_tasks_after_shutdown); |
| 1305 } | 1304 } |
| 1306 | 1305 |
| 1307 bool SequencedWorkerPool::IsShutdownInProgress() { | 1306 bool SequencedWorkerPool::IsShutdownInProgress() { |
| 1308 return inner_->IsShutdownInProgress(); | 1307 return inner_->IsShutdownInProgress(); |
| 1309 } | 1308 } |
| 1310 | 1309 |
| 1311 } // namespace base | 1310 } // namespace base |
| OLD | NEW |