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:
Adam Barth
2017-05-04 15:06:43 -07:00
committed by GitHub
parent 456c1066eb
commit 52247beb87
4 changed files with 4 additions and 4 deletions

2
DEPS
View File

@@ -57,7 +57,7 @@ deps = {
Var('fuchsia_git') + '/ftl' + '@' + 'f1357b6eaa9a23cffec1645dfeba610b5f926b1d',
'src/lib/tonic':
Var('fuchsia_git') + '/tonic' + '@' + '82075233dc0cd23b1c8af5f694eb86dd9bd10f35',
Var('fuchsia_git') + '/tonic' + '@' + '02431161f012a18c32f885e04b1eda51e6c11f8e',
'src/lib/zip':
Var('fuchsia_git') + '/zip' + '@' + '92dc87ca645fe8e9f5151ef6dac86d8311a7222f',

View File

@@ -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

View File

@@ -223,7 +223,7 @@ void Window::BeginFrame(ftl::TimePoint frameTime) {
Dart_NewInteger(microseconds),
});
tonic::DartMicrotaskQueue::RunMicrotasks();
tonic::DartMicrotaskQueue::GetForCurrentThread()->RunMicrotasks();
DartInvokeField(library_.value(), "_drawFrame", {});
}

View File

@@ -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.