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

Side by Side Diff: base/threading/worker_pool_posix.h

Issue 6714032: Move some files in base to base/memory. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: only base Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // The thread pool used in the POSIX implementation of WorkerPool dynamically 5 // The thread pool used in the POSIX implementation of WorkerPool dynamically
6 // adds threads as necessary to handle all tasks. It keeps old threads around 6 // adds threads as necessary to handle all tasks. It keeps old threads around
7 // for a period of time to allow them to be reused. After this waiting period, 7 // for a period of time to allow them to be reused. After this waiting period,
8 // the threads exit. This thread pool uses non-joinable threads, therefore 8 // the threads exit. This thread pool uses non-joinable threads, therefore
9 // worker threads are not joined during process shutdown. This means that 9 // worker threads are not joined during process shutdown. This means that
10 // potentially long running tasks (such as DNS lookup) do not block process 10 // potentially long running tasks (such as DNS lookup) do not block process
(...skipping 11 matching lines...) Expand all
22 // These symbols are exported in a header purely for testing purposes. 22 // These symbols are exported in a header purely for testing purposes.
23 23
24 #ifndef BASE_THREADING_WORKER_POOL_POSIX_H_ 24 #ifndef BASE_THREADING_WORKER_POOL_POSIX_H_
25 #define BASE_THREADING_WORKER_POOL_POSIX_H_ 25 #define BASE_THREADING_WORKER_POOL_POSIX_H_
26 #pragma once 26 #pragma once
27 27
28 #include <queue> 28 #include <queue>
29 #include <string> 29 #include <string>
30 30
31 #include "base/basictypes.h" 31 #include "base/basictypes.h"
32 #include "base/ref_counted.h" 32 #include "base/memory/ref_counted.h"
33 #include "base/scoped_ptr.h" 33 #include "base/memory/scoped_ptr.h"
34 #include "base/synchronization/condition_variable.h" 34 #include "base/synchronization/condition_variable.h"
35 #include "base/synchronization/lock.h" 35 #include "base/synchronization/lock.h"
36 #include "base/threading/platform_thread.h" 36 #include "base/threading/platform_thread.h"
37 37
38 class Task; 38 class Task;
39 39
40 namespace base { 40 namespace base {
41 41
42 class PosixDynamicThreadPool 42 class PosixDynamicThreadPool
43 : public RefCountedThreadSafe<PosixDynamicThreadPool> { 43 : public RefCountedThreadSafe<PosixDynamicThreadPool> {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Only used for tests to ensure correct thread ordering. It will always be 80 // Only used for tests to ensure correct thread ordering. It will always be
81 // NULL in non-test code. 81 // NULL in non-test code.
82 scoped_ptr<ConditionVariable> num_idle_threads_cv_; 82 scoped_ptr<ConditionVariable> num_idle_threads_cv_;
83 83
84 DISALLOW_COPY_AND_ASSIGN(PosixDynamicThreadPool); 84 DISALLOW_COPY_AND_ASSIGN(PosixDynamicThreadPool);
85 }; 85 };
86 86
87 } // namespace base 87 } // namespace base
88 88
89 #endif // BASE_THREADING_WORKER_POOL_POSIX_H_ 89 #endif // BASE_THREADING_WORKER_POOL_POSIX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698