| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 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 #include "base/worker_pool.h" | 5 #include "base/worker_pool.h" |
| 6 | 6 |
| 7 #include "base/logging.h" |
| 7 #include "base/task.h" | 8 #include "base/task.h" |
| 8 | 9 |
| 9 namespace { | 10 namespace { |
| 10 | 11 |
| 11 void* PThreadCallback(void* param) { | 12 void* PThreadCallback(void* param) { |
| 12 Task* task = static_cast<Task*>(param); | 13 Task* task = static_cast<Task*>(param); |
| 13 task->Run(); | 14 task->Run(); |
| 14 delete task; | 15 delete task; |
| 15 return 0; | 16 return 0; |
| 16 } | 17 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 33 int err = pthread_create(&thread, &attr, PThreadCallback, task); | 34 int err = pthread_create(&thread, &attr, PThreadCallback, task); |
| 34 pthread_attr_destroy(&attr); | 35 pthread_attr_destroy(&attr); |
| 35 if (err) { | 36 if (err) { |
| 36 DLOG(ERROR) << "pthread_create failed: " << err; | 37 DLOG(ERROR) << "pthread_create failed: " << err; |
| 37 delete task; | 38 delete task; |
| 38 return false; | 39 return false; |
| 39 } | 40 } |
| 40 | 41 |
| 41 return true; | 42 return true; |
| 42 } | 43 } |
| OLD | NEW |