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/worker_pool.h" | 5 #include "base/threading/worker_pool.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/debug/trace_event.h" | |
10 #include "base/logging.h" | 9 #include "base/logging.h" |
11 #include "base/pending_task.h" | 10 #include "base/pending_task.h" |
12 #include "base/threading/thread_local.h" | 11 #include "base/threading/thread_local.h" |
| 12 #include "base/trace_event/trace_event.h" |
13 #include "base/tracked_objects.h" | 13 #include "base/tracked_objects.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 base::LazyInstance<ThreadLocalBoolean>::Leaky | 19 base::LazyInstance<ThreadLocalBoolean>::Leaky |
20 g_worker_pool_running_on_this_thread = LAZY_INSTANCE_INITIALIZER; | 20 g_worker_pool_running_on_this_thread = LAZY_INSTANCE_INITIALIZER; |
21 | 21 |
22 DWORD CALLBACK WorkItemCallback(void* param) { | 22 DWORD CALLBACK WorkItemCallback(void* param) { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 PendingTask* pending_task = new PendingTask(from_here, task); | 66 PendingTask* pending_task = new PendingTask(from_here, task); |
67 return PostTaskInternal(pending_task, task_is_slow); | 67 return PostTaskInternal(pending_task, task_is_slow); |
68 } | 68 } |
69 | 69 |
70 // static | 70 // static |
71 bool WorkerPool::RunsTasksOnCurrentThread() { | 71 bool WorkerPool::RunsTasksOnCurrentThread() { |
72 return g_worker_pool_running_on_this_thread.Get().Get(); | 72 return g_worker_pool_running_on_this_thread.Get().Get(); |
73 } | 73 } |
74 | 74 |
75 } // namespace base | 75 } // namespace base |
OLD | NEW |