OLD | NEW |
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 #include "src/cancelable-task.h" | 5 #include "src/cancelable-task.h" |
6 | 6 |
7 #include "src/base/platform/platform.h" | 7 #include "src/base/platform/platform.h" |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 cancelable_tasks_.erase(current); | 86 cancelable_tasks_.erase(current); |
87 } | 87 } |
88 } | 88 } |
89 // Wait for already running background tasks. | 89 // Wait for already running background tasks. |
90 if (!cancelable_tasks_.empty()) { | 90 if (!cancelable_tasks_.empty()) { |
91 cancelable_tasks_barrier_.Wait(&mutex_); | 91 cancelable_tasks_barrier_.Wait(&mutex_); |
92 } | 92 } |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
| 96 CancelableTask::CancelableTask(Isolate* isolate) |
| 97 : CancelableTask(isolate, isolate->cancelable_task_manager()) {} |
96 | 98 |
97 CancelableTask::CancelableTask(Isolate* isolate) | 99 CancelableTask::CancelableTask(Isolate* isolate, CancelableTaskManager* manager) |
98 : Cancelable(isolate->cancelable_task_manager()), isolate_(isolate) {} | 100 : Cancelable(manager), isolate_(isolate) {} |
99 | |
100 | 101 |
101 CancelableIdleTask::CancelableIdleTask(Isolate* isolate) | 102 CancelableIdleTask::CancelableIdleTask(Isolate* isolate) |
102 : Cancelable(isolate->cancelable_task_manager()), isolate_(isolate) {} | 103 : CancelableIdleTask(isolate, isolate->cancelable_task_manager()) {} |
| 104 |
| 105 CancelableIdleTask::CancelableIdleTask(Isolate* isolate, |
| 106 CancelableTaskManager* manager) |
| 107 : Cancelable(manager), isolate_(isolate) {} |
103 | 108 |
104 } // namespace internal | 109 } // namespace internal |
105 } // namespace v8 | 110 } // namespace v8 |
OLD | NEW |