mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 15:01:29 +00:00
91ea353298
TEST=Fixes standalone/io/exit_works_with_blocked_isolate_test in app-jit mode Change-Id: Icd4f43dfe524b5a9f8569a520a661289214bfddf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287461 Reviewed-by: Daco Harkes <dacoharkes@google.com>
25 lines
702 B
Dart
25 lines
702 B
Dart
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import "dart:io";
|
|
import "dart:isolate";
|
|
|
|
final bool isAppJitTrainingRun =
|
|
Platform.executableArguments.any((arg) => arg == '--snapshot-kind=app-jit');
|
|
|
|
child(msg) {
|
|
// This should work even though the parent isolate is blocked and won't
|
|
// respond to OOB messages such as shutdown requests.
|
|
exit(0);
|
|
}
|
|
|
|
main() {
|
|
if (isAppJitTrainingRun) return;
|
|
|
|
Isolate.spawn(child, null);
|
|
|
|
// The test harness provides no input, so this will block forever.
|
|
stdin.readByteSync();
|
|
}
|