forked from firka/flutter
Make microtask queue be per thread (flutter/engine#3644)
Previously, it was a static. Doesn't have much effect in practice because we only use this microtask queue for main isolates, which exist on a single thread.
This commit is contained in:
@@ -172,7 +172,7 @@ void ScheduleMicrotask(Dart_NativeArguments args) {
|
||||
Dart_Handle closure = Dart_GetNativeArgument(args, 0);
|
||||
if (LogIfError(closure) || !Dart_IsClosure(closure))
|
||||
return;
|
||||
tonic::DartMicrotaskQueue::ScheduleMicrotask(closure);
|
||||
tonic::DartMicrotaskQueue::GetForCurrentThread()->ScheduleMicrotask(closure);
|
||||
}
|
||||
|
||||
} // namespace blink
|
||||
|
||||
@@ -223,7 +223,7 @@ void Window::BeginFrame(ftl::TimePoint frameTime) {
|
||||
Dart_NewInteger(microseconds),
|
||||
});
|
||||
|
||||
tonic::DartMicrotaskQueue::RunMicrotasks();
|
||||
tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks();
|
||||
|
||||
DartInvokeField(library_.value(), "_drawFrame", {});
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ void RunNonInteractive(ftl::CommandLine initial_command_line,
|
||||
if (error == tonic::kNoError)
|
||||
error = task_observer.last_error();
|
||||
if (error == tonic::kNoError)
|
||||
error = tonic::DartMicrotaskQueue::GetLastError();
|
||||
error = tonic::DartMicrotaskQueue::GetForCurrentThread()->GetLastError();
|
||||
|
||||
// The script has completed and the engine may not be in a clean state,
|
||||
// so just stop the process.
|
||||
|
||||
Reference in New Issue
Block a user