summaryrefslogtreecommitdiffstats
path: root/base/worker_pool_linux.cc
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 23:15:58 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-05 23:15:58 +0000
commit56fedfa29f49ce793d3343525f120eaff5f2b752 (patch)
treea4b709a6fbc9587338f3fed58f5f885e8138486a /base/worker_pool_linux.cc
parent27bc9e8ac1922f88fbe003c9b050add4e27321b0 (diff)
downloadchromium_src-56fedfa29f49ce793d3343525f120eaff5f2b752.zip
chromium_src-56fedfa29f49ce793d3343525f120eaff5f2b752.tar.gz
chromium_src-56fedfa29f49ce793d3343525f120eaff5f2b752.tar.bz2
[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
Diffstat (limited to 'base/worker_pool_linux.cc')
-rw-r--r--base/worker_pool_linux.cc18
1 files changed, 18 insertions, 0 deletions
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 {