Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(152)

Side by Side Diff: base/threading/sequenced_worker_pool.cc

Issue 1860653002: CL for testing on Win. Base URL: https://chromium.googlesource.com/chromium/src.git@task_file
Patch Set: more logs. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | base/trace_event/trace_event_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_TASK_EXECUTION("SequencedWorkerPool::Inner::ThreadLoop", task);
814 TRACE_TASK_EXECUTION("SequencedWorkerPool::Inner::ThreadLoop", task);
815 TRACE_TASK_EXECUTION("SequencedWorkerPool::Inner::ThreadLoop", task);
816 TRACE_EVENT_WITH_FLOW2(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
817 "SequencedWorkerPool::Inner::ThreadLoop",
818 TRACE_ID_MANGLE(GetTaskTraceID(task, static_cast<void*>(this))),
819 TRACE_EVENT_FLAG_FLOW_OUT,
820 "src_file", task.posted_from.file_name(),
821 "src_func", task.posted_from.function_name());
822 TRACE_TASK_EXECUTION("SequencedWorkerPool::Inner::ThreadLoop", task);
823 TRACE_TASK_EXECUTION("SequencedWorkerPool::Inner::ThreadLoop", task);
824 TRACE_EVENT_WITH_FLOW2(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
825 "SequencedWorkerPool::Inner::ThreadLoop",
826 TRACE_ID_MANGLE(GetTaskTraceID(task, static_cast<void*>(this))),
827 TRACE_EVENT_FLAG_FLOW_IN,
828 "src_file", task.posted_from.file_name(),
829 "src_func", task.posted_from.function_name());
830 TRACE_TASK_EXECUTION("SequencedWorkerPool::Inner::ThreadLoop", task);
831 TRACE_TASK_EXECUTION("SequencedWorkerPool::Inner::ThreadLoop", task);
832 TRACE_EVENT_WITH_FLOW2(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
833 "SequencedWorkerPool::Inner::ThreadLoop",
834 TRACE_ID_MANGLE(GetTaskTraceID(task, static_cast<void*>(this))),
835 TRACE_EVENT_FLAG_FLOW_OUT,
836 "src_file", task.posted_from.file_name(),
837 "src_func", task.posted_from.function_name());
838 TRACE_TASK_EXECUTION("SequencedWorkerPool::Inner::ThreadLoop", task);
839 TRACE_EVENT_WITH_FLOW2(TRACE_DISABLED_BY_DEFAULT("toplevel.flow"),
840 "SequencedWorkerPool::Inner::ThreadLoop",
841 TRACE_ID_MANGLE(GetTaskTraceID(task, static_cast<void*>(this))),
842 TRACE_EVENT_FLAG_FLOW_IN,
843 "src_file", task.posted_from.file_name(),
844 "src_func", task.posted_from.function_name());
813 int new_thread_id = WillRunWorkerTask(task); 845 int new_thread_id = WillRunWorkerTask(task);
814 { 846 {
815 AutoUnlock unlock(lock_); 847 AutoUnlock unlock(lock_);
816 // There may be more work available, so wake up another 848 // There may be more work available, so wake up another
817 // worker thread. (Technically not required, since we 849 // worker thread. (Technically not required, since we
818 // already get a signal for each new task, but it doesn't 850 // already get a signal for each new task, but it doesn't
819 // hurt.) 851 // hurt.)
820 SignalHasWork(); 852 SignalHasWork();
821 delete_these_outside_lock.clear(); 853 delete_these_outside_lock.clear();
822 854
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) { 1428 void SequencedWorkerPool::Shutdown(int max_new_blocking_tasks_after_shutdown) {
1397 DCHECK(constructor_task_runner_->BelongsToCurrentThread()); 1429 DCHECK(constructor_task_runner_->BelongsToCurrentThread());
1398 inner_->Shutdown(max_new_blocking_tasks_after_shutdown); 1430 inner_->Shutdown(max_new_blocking_tasks_after_shutdown);
1399 } 1431 }
1400 1432
1401 bool SequencedWorkerPool::IsShutdownInProgress() { 1433 bool SequencedWorkerPool::IsShutdownInProgress() {
1402 return inner_->IsShutdownInProgress(); 1434 return inner_->IsShutdownInProgress();
1403 } 1435 }
1404 1436
1405 } // namespace base 1437 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/trace_event_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698