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

Side by Side Diff: base/threading/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/threading/worker_pool_unittest.cc ('k') | base/watchdog.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/threading/worker_pool.h"
6
7 #include "base/logging.h"
8 #include "base/task.h"
9
10 namespace base {
11
12 namespace {
13
14 DWORD CALLBACK WorkItemCallback(void* param) {
15 Task* task = static_cast<Task*>(param);
16 task->Run();
17 delete task;
18 return 0;
19 }
20
21 } // namespace
22
23 bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
24 Task* task, bool task_is_slow) {
25 task->SetBirthPlace(from_here);
26
27 ULONG flags = 0;
28 if (task_is_slow)
29 flags |= WT_EXECUTELONGFUNCTION;
30
31 if (!QueueUserWorkItem(WorkItemCallback, task, flags)) {
32 DLOG(ERROR) << "QueueUserWorkItem failed: " << GetLastError();
33 delete task;
34 return false;
35 }
36
37 return true;
38 }
39
40 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/worker_pool_unittest.cc ('k') | base/watchdog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698