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 |
96 CancelableTask::CancelableTask(Isolate* isolate) | 97 CancelableTask::CancelableTask(Isolate* isolate) |
97 : CancelableTask(isolate, isolate->cancelable_task_manager()) {} | 98 : Cancelable(isolate->cancelable_task_manager()), isolate_(isolate) {} |
98 | 99 |
99 CancelableTask::CancelableTask(Isolate* isolate, CancelableTaskManager* manager) | |
100 : Cancelable(manager), isolate_(isolate) {} | |
101 | 100 |
102 CancelableIdleTask::CancelableIdleTask(Isolate* isolate) | 101 CancelableIdleTask::CancelableIdleTask(Isolate* isolate) |
103 : CancelableIdleTask(isolate, isolate->cancelable_task_manager()) {} | 102 : Cancelable(isolate->cancelable_task_manager()), isolate_(isolate) {} |
104 | |
105 CancelableIdleTask::CancelableIdleTask(Isolate* isolate, | |
106 CancelableTaskManager* manager) | |
107 : Cancelable(manager), isolate_(isolate) {} | |
108 | 103 |
109 } // namespace internal | 104 } // namespace internal |
110 } // namespace v8 | 105 } // namespace v8 |
OLD | NEW |