Chromium Code Reviews| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 803 std::vector<Closure> delete_these_outside_lock; | 803 std::vector<Closure> delete_these_outside_lock; |
| 804 GetWorkStatus status = | 804 GetWorkStatus status = |
| 805 GetWork(&task, &wait_time, &delete_these_outside_lock); | 805 GetWork(&task, &wait_time, &delete_these_outside_lock); |
| 806 if (status == GET_WORK_FOUND) { | 806 if (status == GET_WORK_FOUND) { |
| 807 TRACE_EVENT_WITH_FLOW2(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"), | 807 TRACE_EVENT_WITH_FLOW2(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"), |
| 808 "SequencedWorkerPool::Inner::ThreadLoop", | 808 "SequencedWorkerPool::Inner::ThreadLoop", |
| 809 TRACE_ID_MANGLE(GetTaskTraceID(task, static_cast<void*>(this))), | 809 TRACE_ID_MANGLE(GetTaskTraceID(task, static_cast<void*>(this))), |
| 810 TRACE_EVENT_FLAG_FLOW_IN, | 810 TRACE_EVENT_FLAG_FLOW_IN, |
| 811 "src_file", task.posted_from.file_name(), | 811 "src_file", task.posted_from.file_name(), |
| 812 "src_func", task.posted_from.function_name()); | 812 "src_func", task.posted_from.function_name()); |
| 813 TRACE_EVENT_API_SCOPED_TASK_EXECUTION_EVENT INTERNAL_TRACE_EVENT_UID( | |
|
Primiano Tucci (use gerrit)
2016/05/04 08:21:50
you don't need EVENT INTERNAL_TRACE_EVENT_UID here
ssid
2016/05/06 03:15:26
I added this because every time i didn't in past y
Primiano Tucci (use gerrit)
2016/05/06 10:22:03
Oops. I hope I didn't suggest in non-tracing code,
| |
| 814 task_event)(task.posted_from.file_name()); | |
| 813 int new_thread_id = WillRunWorkerTask(task); | 815 int new_thread_id = WillRunWorkerTask(task); |
| 814 { | 816 { |
| 815 AutoUnlock unlock(lock_); | 817 AutoUnlock unlock(lock_); |
| 816 // There may be more work available, so wake up another | 818 // There may be more work available, so wake up another |
| 817 // worker thread. (Technically not required, since we | 819 // worker thread. (Technically not required, since we |
| 818 // already get a signal for each new task, but it doesn't | 820 // already get a signal for each new task, but it doesn't |
| 819 // hurt.) | 821 // hurt.) |
| 820 SignalHasWork(); | 822 SignalHasWork(); |
| 821 delete_these_outside_lock.clear(); | 823 delete_these_outside_lock.clear(); |
| 822 | 824 |
| (...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1396 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) { | 1398 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) { |
| 1397 DCHECK(constructor_task_runner_->BelongsToCurrentThread()); | 1399 DCHECK(constructor_task_runner_->BelongsToCurrentThread()); |
| 1398 inner_->Shutdown(max_new_blocking_tasks_after_shutdown); | 1400 inner_->Shutdown(max_new_blocking_tasks_after_shutdown); |
| 1399 } | 1401 } |
| 1400 | 1402 |
| 1401 bool SequencedWorkerPool::IsShutdownInProgress() { | 1403 bool SequencedWorkerPool::IsShutdownInProgress() { |
| 1402 return inner_->IsShutdownInProgress(); | 1404 return inner_->IsShutdownInProgress(); |
| 1403 } | 1405 } |
| 1404 | 1406 |
| 1405 } // namespace base | 1407 } // namespace base |
| OLD | NEW |