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

Unified Diff: src/cancelable-task.cc

Issue 2454723002: Reland "[heap] Uncommit marking deque in concurrent task." (Closed)
Patch Set: one more ce fix Created 4 years, 2 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 | « src/cancelable-task.h ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cancelable-task.cc
diff --git a/src/cancelable-task.cc b/src/cancelable-task.cc
index 5638e23fbf8a3674a51e2bbfa9f770f1396c8d56..9bbddca6b24a9f8483d7665d6512907c064157d7 100644
--- a/src/cancelable-task.cc
+++ b/src/cancelable-task.cc
@@ -48,8 +48,8 @@ void CancelableTaskManager::RemoveFinishedTask(uint32_t id) {
cancelable_tasks_barrier_.NotifyOne();
}
-
-bool CancelableTaskManager::TryAbort(uint32_t id) {
+CancelableTaskManager::TryAbortResult CancelableTaskManager::TryAbort(
+ uint32_t id) {
base::LockGuard<base::Mutex> guard(&mutex_);
auto entry = cancelable_tasks_.find(id);
if (entry != cancelable_tasks_.end()) {
@@ -58,10 +58,12 @@ bool CancelableTaskManager::TryAbort(uint32_t id) {
// Cannot call RemoveFinishedTask here because of recursive locking.
cancelable_tasks_.erase(entry);
cancelable_tasks_barrier_.NotifyOne();
- return true;
+ return kTaskAborted;
+ } else {
+ return kTaskRunning;
}
}
- return false;
+ return kTaskRemoved;
}
« no previous file with comments | « src/cancelable-task.h ('k') | src/heap/mark-compact.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698