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

Unified Diff: base/threading/worker_pool_posix.cc

Issue 1044413002: Record async "task backtraces" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/pending_task.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/threading/worker_pool_posix.cc
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc
index 32a5e92b91c7fa99f241ead417fcc231d70ca539..a10ac8e05139afead4614e26cab29e86ce80e990 100644
--- a/base/threading/worker_pool_posix.cc
+++ b/base/threading/worker_pool_posix.cc
@@ -140,7 +140,9 @@ void PosixDynamicThreadPool::Terminate() {
void PosixDynamicThreadPool::PostTask(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- PendingTask pending_task(from_here, task);
+ PendingTask pending_task(from_here,
+ MessageLoop::current()->current_pending_task_,
danakj 2015/04/03 17:18:35 The use of MessageLoop::current()->current_pending
+ task);
AddTask(&pending_task);
}
@@ -168,7 +170,7 @@ PendingTask PosixDynamicThreadPool::WaitForTask() {
AutoLock locked(lock_);
if (terminated_)
- return PendingTask(FROM_HERE, base::Closure());
+ return PendingTask(FROM_HERE, NULL, base::Closure());
if (pending_tasks_.empty()) { // No work available, wait for work.
num_idle_threads_++;
@@ -182,7 +184,7 @@ PendingTask PosixDynamicThreadPool::WaitForTask() {
if (pending_tasks_.empty()) {
// We waited for work, but there's still no work. Return NULL to signal
// the thread to terminate.
- return PendingTask(FROM_HERE, base::Closure());
+ return PendingTask(FROM_HERE, NULL, base::Closure());
}
}
« no previous file with comments | « base/pending_task.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698