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

Side by Side Diff: src/cancelable-task.h

Issue 2615603002: Implement async AbortAll for the compiler dispatcher (Closed)
Patch Set: updates Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/cancelable-task.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_CANCELABLE_TASK_H_ 5 #ifndef V8_CANCELABLE_TASK_H_
6 #define V8_CANCELABLE_TASK_H_ 6 #define V8_CANCELABLE_TASK_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "include/v8-platform.h" 10 #include "include/v8-platform.h"
(...skipping 27 matching lines...) Expand all
38 // (3) The task is not yet running (or finished) so it is canceled and 38 // (3) The task is not yet running (or finished) so it is canceled and
39 // removed. 39 // removed.
40 // 40 //
41 enum TryAbortResult { kTaskRemoved, kTaskRunning, kTaskAborted }; 41 enum TryAbortResult { kTaskRemoved, kTaskRunning, kTaskAborted };
42 TryAbortResult TryAbort(uint32_t id); 42 TryAbortResult TryAbort(uint32_t id);
43 43
44 // Cancels all remaining registered tasks and waits for tasks that are 44 // Cancels all remaining registered tasks and waits for tasks that are
45 // already running. This disallows subsequent Register calls. 45 // already running. This disallows subsequent Register calls.
46 void CancelAndWait(); 46 void CancelAndWait();
47 47
48 // Tries to cancel all remaining registered tasks. The return value indicates
49 // whether
50 //
51 // 1) No tasks were registered (kTaskRemoved), or
52 //
53 // 2) There is at least one remaining task that couldn't be cancelled
54 // (kTaskRunning), or
55 //
56 // 3) All registered tasks were cancelled (kTaskAborted).
57 TryAbortResult TryAbortAll();
58
48 private: 59 private:
49 // Only called by {Cancelable} destructor. The task is done with executing, 60 // Only called by {Cancelable} destructor. The task is done with executing,
50 // but needs to be removed. 61 // but needs to be removed.
51 void RemoveFinishedTask(uint32_t id); 62 void RemoveFinishedTask(uint32_t id);
52 63
53 // To mitigate the ABA problem, the api refers to tasks through an id. 64 // To mitigate the ABA problem, the api refers to tasks through an id.
54 uint32_t task_id_counter_; 65 uint32_t task_id_counter_;
55 66
56 // A set of cancelable tasks that are currently registered. 67 // A set of cancelable tasks that are currently registered.
57 std::map<uint32_t, Cancelable*> cancelable_tasks_; 68 std::map<uint32_t, Cancelable*> cancelable_tasks_;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 private: 176 private:
166 Isolate* isolate_; 177 Isolate* isolate_;
167 DISALLOW_COPY_AND_ASSIGN(CancelableIdleTask); 178 DISALLOW_COPY_AND_ASSIGN(CancelableIdleTask);
168 }; 179 };
169 180
170 181
171 } // namespace internal 182 } // namespace internal
172 } // namespace v8 183 } // namespace v8
173 184
174 #endif // V8_CANCELABLE_TASK_H_ 185 #endif // V8_CANCELABLE_TASK_H_
OLDNEW
« no previous file with comments | « no previous file | src/cancelable-task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698