summaryrefslogtreecommitdiffstats
path: root/base/worker_pool.cc
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:38:38 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-07-30 04:38:38 +0000
commit43a973aeb04b5d0ac64bb730cadf0737de8b0cd9 (patch)
treeb1e1a322efd6c17a0446169da51ec376c6ab9a65 /base/worker_pool.cc
parentb124be829f4d6907c17238ab1c84eed5acc817eb (diff)
downloadchromium_src-43a973aeb04b5d0ac64bb730cadf0737de8b0cd9.zip
chromium_src-43a973aeb04b5d0ac64bb730cadf0737de8b0cd9.tar.gz
chromium_src-43a973aeb04b5d0ac64bb730cadf0737de8b0cd9.tar.bz2
Do not use RecycleOrDelete since it is not ready for prime-time.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/worker_pool.cc')
-rw-r--r--base/worker_pool.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/base/worker_pool.cc b/base/worker_pool.cc
index e70edad..50446c6 100644
--- a/base/worker_pool.cc
+++ b/base/worker_pool.cc
@@ -29,27 +29,30 @@
#include "base/worker_pool.h"
-#include "base/logging.h"
+#include "base/task.h"
namespace {
DWORD CALLBACK WorkItemCallback(void* param) {
Task* task = static_cast<Task*>(param);
task->Run();
- WorkerPool::RecycleTask(task);
+ delete task;
return 0;
}
} // namespace
-bool WorkerPool::Run(Task* task, bool slow) {
+bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
+ Task* task, bool task_is_slow) {
+ task->SetBirthPlace(from_here);
+
ULONG flags = 0;
- if (slow)
+ if (task_is_slow)
flags |= WT_EXECUTELONGFUNCTION;
if (!QueueUserWorkItem(WorkItemCallback, task, flags)) {
DLOG(ERROR) << "QueueUserWorkItem failed: " << GetLastError();
- RecycleTask(task);
+ delete task;
return false;
}