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

Side by Side Diff: base/worker_pool_win.cc

Issue 6079009: Move some misc thread-related stuff from base to base/thread and into the bas... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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
« no previous file with comments | « base/worker_pool_unittest.cc ('k') | chrome/browser/jankometer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/worker_pool.h"
6
7 #include "base/logging.h"
8 #include "base/task.h"
9
10 namespace {
11
12 DWORD CALLBACK WorkItemCallback(void* param) {
13 Task* task = static_cast<Task*>(param);
14 task->Run();
15 delete task;
16 return 0;
17 }
18
19 } // namespace
20
21 bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
22 Task* task, bool task_is_slow) {
23 task->SetBirthPlace(from_here);
24
25 ULONG flags = 0;
26 if (task_is_slow)
27 flags |= WT_EXECUTELONGFUNCTION;
28
29 if (!QueueUserWorkItem(WorkItemCallback, task, flags)) {
30 DLOG(ERROR) << "QueueUserWorkItem failed: " << GetLastError();
31 delete task;
32 return false;
33 }
34
35 return true;
36 }
OLDNEW
« no previous file with comments | « base/worker_pool_unittest.cc ('k') | chrome/browser/jankometer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698