File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ class AsyncTaskSchedulerImpl : public AsyncTaskScheduler {
170170 if (IsAborted ()) {
171171 return false ;
172172 }
173+ running_tasks_set_.insert (task.get ());
173174 SubmitTaskUnlocked (std::move (task), std::move (lk));
174175 return true ;
175176 }
@@ -210,6 +211,7 @@ class AsyncTaskSchedulerImpl : public AsyncTaskScheduler {
210211 // OnTaskFinished might trigger the scheduler to end. We want to ensure that
211212 // is the very last thing that happens after all task destructors have run so
212213 // we eagerly destroy the task first.
214+ running_tasks_set_.erase (task_inner2.get ());
213215 task_inner2.reset ();
214216 OnTaskFinished (st);
215217 };
@@ -267,6 +269,7 @@ class AsyncTaskSchedulerImpl : public AsyncTaskScheduler {
267269 return DoSubmitTask (std::move (task));
268270 }
269271
272+ std::unordered_set<Task*> running_tasks_set_;
270273 Future<> finished_ = Future<>::Make();
271274 // The initial task is our first task
272275 int running_tasks_ = 1 ;
You can’t perform that action at this time.
0 commit comments