Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(825)

Unified Diff: runtime/bin/vmservice/vmservice_io.dart

Issue 1998963003: Rework standalone to use a synchronous loader that does not invoke Dart code (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/vmservice/loader.dart ('k') | runtime/include/dart_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice/vmservice_io.dart
diff --git a/runtime/bin/vmservice/vmservice_io.dart b/runtime/bin/vmservice/vmservice_io.dart
index ba8244111ab2a0cc16aeb85d2ef1bd45e9bd19c4..bfa99a6830d99593cf705f3fc68d2d66e5419509 100644
--- a/runtime/bin/vmservice/vmservice_io.dart
+++ b/runtime/bin/vmservice/vmservice_io.dart
@@ -39,6 +39,7 @@ _lazyServerBoot() {
}
Future cleanupCallback() async {
+ shutdownLoaders();
// Cancel the sigquit subscription.
if (_signalSubscription != null) {
await _signalSubscription.cancel();
@@ -51,6 +52,10 @@ Future cleanupCallback() async {
print("Error in vm-service shutdown: $e\n$st\n");
}
}
+ if (_registerSignalHandlerTimer != null) {
+ _registerSignalHandlerTimer.cancel();
+ _registerSignalHandlerTimer = null;
+ }
// Call out to embedder's shutdown callback.
_shutdown();
}
@@ -73,7 +78,10 @@ _onSignal(ProcessSignal signal) {
}
}
+Timer _registerSignalHandlerTimer;
+
_registerSignalHandler() {
+ _registerSignalHandlerTimer = null;
if (_signalWatch == null) {
// Cannot register for signals.
return;
@@ -88,6 +96,9 @@ _registerSignalHandler() {
main() {
// Set embedder hooks.
VMServiceEmbedderHooks.cleanup = cleanupCallback;
+ // Always instantiate the vmservice object so that the exit message
+ // can be delivered and waiting loaders can be cancelled.
+ var service = new VMService();
if (_autoStart) {
_lazyServerBoot();
server.startup();
@@ -95,12 +106,10 @@ main() {
// scheduled microtasks.
Timer.run(() {});
}
- // TODO(johnmccutchan): Fixup service isolate shutdown in the general case.
- // See ServiceIsolate::KillServiceIsolate and ServiceIsolate::Shutdown.
scriptLoadPort.handler = _processLoadRequest;
// Register signal handler after a small delay to avoid stalling main
// isolate startup.
- new Timer(shortDelay, _registerSignalHandler);
+ _registerSignalHandlerTimer = new Timer(shortDelay, _registerSignalHandler);
return scriptLoadPort;
}
« no previous file with comments | « runtime/bin/vmservice/loader.dart ('k') | runtime/include/dart_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698