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

Unified Diff: base/worker_pool_win.cc

Issue 39081: Split worker_pool.cc into worker_pool_linux.cc and worker_pool_win.cc (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/worker_pool_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/worker_pool_win.cc
===================================================================
--- base/worker_pool_win.cc (revision 10718)
+++ base/worker_pool_win.cc (working copy)
@@ -6,9 +6,6 @@
#include "base/task.h"
-// TODO(dsh): Split this file into worker_pool_win.cc and worker_pool_posix.cc.
-#if defined(OS_WIN)
-
namespace {
DWORD CALLBACK WorkItemCallback(void* param) {
@@ -36,42 +33,3 @@
return true;
}
-
-#elif defined(OS_LINUX)
-
-namespace {
-
-void* PThreadCallback(void* param) {
- Task* task = static_cast<Task*>(param);
- task->Run();
- delete task;
- return 0;
-}
-
-} // namespace
-
-bool WorkerPool::PostTask(const tracked_objects::Location& from_here,
- Task* task, bool task_is_slow) {
- task->SetBirthPlace(from_here);
-
- pthread_t thread;
- pthread_attr_t attr;
-
- // POSIX does not have a worker thread pool implementation. For now we just
- // create a thread for each task, and ignore |task_is_slow|.
- // TODO(dsh): Implement thread reuse.
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-
- int err = pthread_create(&thread, &attr, PThreadCallback, task);
- pthread_attr_destroy(&attr);
- if (err) {
- DLOG(ERROR) << "pthread_create failed: " << err;
- delete task;
- return false;
- }
-
- return true;
-}
-
-#endif // OS_LINUX
« no previous file with comments | « base/worker_pool_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698