Index: base/threading/worker_pool_posix.h |
diff --git a/base/threading/worker_pool_posix.h b/base/threading/worker_pool_posix.h |
index 2cc1150e1612a4b5748bd27b0a1b1974ab792775..1b5032b569c9a8f1c9cd61156d1e26ef504f5c54 100644 |
--- a/base/threading/worker_pool_posix.h |
+++ b/base/threading/worker_pool_posix.h |
@@ -34,6 +34,7 @@ |
#include "base/time.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/pending_task.h" |
#include "base/synchronization/condition_variable.h" |
#include "base/synchronization/lock.h" |
#include "base/threading/platform_thread.h" |
@@ -48,23 +49,6 @@ class BASE_EXPORT PosixDynamicThreadPool |
public: |
class PosixDynamicThreadPoolPeer; |
- struct PendingTask { |
- PendingTask(const tracked_objects::Location& posted_from, |
- const base::Closure& task); |
- ~PendingTask(); |
- |
- // Counter for location where the Closure was posted from. |
- tracked_objects::Births* birth_tally; |
- |
- // Time the task was posted. |
- tracked_objects::TrackedTime time_posted; |
- |
- const tracked_objects::Location posted_from; |
- |
- // The task to run. |
- base::Closure task; |
- }; |
- |
// All worker threads will share the same |name_prefix|. They will exit after |
// |idle_seconds_before_exit|. |
PosixDynamicThreadPool(const std::string& name_prefix, |
@@ -84,7 +68,7 @@ class BASE_EXPORT PosixDynamicThreadPool |
// Adds |task| to the thread pool. |
void PostTask(const tracked_objects::Location& from_here, |
- const base::Closure& task); |
+ const Closure& task); |
// Worker thread method to wait for up to |idle_seconds_before_exit| for more |
// work from the thread pool. Returns NULL if no work is available. |
@@ -107,7 +91,7 @@ class BASE_EXPORT PosixDynamicThreadPool |
// is being deleted and they can exit. |
ConditionVariable pending_tasks_available_cv_; |
int num_idle_threads_; |
- std::queue<PendingTask> pending_tasks_; |
+ TaskQueue pending_tasks_; |
bool terminated_; |
// Only used for tests to ensure correct thread ordering. It will always be |
// NULL in non-test code. |