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_posix.h" | 5 #include "base/threading/worker_pool_posix.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
18 #include "base/threading/platform_thread.h" | 18 #include "base/threading/platform_thread.h" |
19 #include "base/threading/thread_local.h" | 19 #include "base/threading/thread_local.h" |
20 #include "base/threading/worker_pool.h" | 20 #include "base/threading/worker_pool.h" |
21 #include "base/trace_event/trace_event.h" | 21 #include "base/trace_event/trace_event.h" |
22 #include "base/tracked_objects.h" | 22 #include "base/tracked_objects.h" |
23 | 23 |
24 using tracked_objects::TrackedTime; | |
25 | |
26 namespace base { | 24 namespace base { |
27 | 25 |
28 namespace { | 26 namespace { |
29 | 27 |
30 base::LazyInstance<ThreadLocalBoolean>::Leaky | 28 base::LazyInstance<ThreadLocalBoolean>::Leaky |
31 g_worker_pool_running_on_this_thread = LAZY_INSTANCE_INITIALIZER; | 29 g_worker_pool_running_on_this_thread = LAZY_INSTANCE_INITIALIZER; |
32 | 30 |
33 const int kIdleSecondsBeforeExit = 10 * 60; | 31 const int kIdleSecondsBeforeExit = 10 * 60; |
34 | 32 |
35 #if defined(OS_MACOSX) | 33 #if defined(OS_MACOSX) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 return PendingTask(FROM_HERE, base::Closure()); | 183 return PendingTask(FROM_HERE, base::Closure()); |
186 } | 184 } |
187 } | 185 } |
188 | 186 |
189 PendingTask pending_task = std::move(pending_tasks_.front()); | 187 PendingTask pending_task = std::move(pending_tasks_.front()); |
190 pending_tasks_.pop(); | 188 pending_tasks_.pop(); |
191 return pending_task; | 189 return pending_task; |
192 } | 190 } |
193 | 191 |
194 } // namespace base | 192 } // namespace base |
OLD | NEW |