From 56fedfa29f49ce793d3343525f120eaff5f2b752 Mon Sep 17 00:00:00 2001 From: "shess@chromium.org" Date: Fri, 5 Nov 2010 23:15:58 +0000 Subject: [Mac] Use Linux WorkerPool code. Adapts things to use the Linux WorkerPool code by default, with --disable-linux-workerpool to switch back to the old version. The old implementation uses NSOperationQueue, which is implemented in terms of pthread workqueues. These are implicated by the stack traces from the recent unit test flakiness. This change attempts to influence that flakiness. BUG=20471, 60426 TEST=Tree green. Review URL: http://codereview.chromium.org/4595001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65273 0039d316-1c4b-4281-b951-d872f2087c98 --- base/worker_pool_linux.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'base/worker_pool_linux.cc') diff --git a/base/worker_pool_linux.cc b/base/worker_pool_linux.cc index 2aa1df2..8c96ca0 100644 --- a/base/worker_pool_linux.cc +++ b/base/worker_pool_linux.cc @@ -84,11 +84,29 @@ void WorkerThread::ThreadMain() { } // namespace +// NOTE(shess): Temporarily allow the Mac WorkerPool implementation to +// call into the linux so that it can provide a command-line flag for +// switching back and forth. After evaluating, either remove the +// ifdef, or shift this to a shared POSIX implementation. +// http://crbug.com/44392 +#if defined(OS_MACOSX) +namespace worker_pool_mac { + +bool MacPostTaskHelper(const tracked_objects::Location& from_here, + Task* task, bool task_is_slow) { + g_lazy_worker_pool.Pointer()->PostTask(from_here, task, task_is_slow); + return true; +} + +} // namespace worker_pool_mac + +#else bool WorkerPool::PostTask(const tracked_objects::Location& from_here, Task* task, bool task_is_slow) { g_lazy_worker_pool.Pointer()->PostTask(from_here, task, task_is_slow); return true; } +#endif namespace base { -- cgit v1.1