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

Side by Side Diff: runtime/tests/vm/dart/spawn_shutdown_test.dart

Issue 1177153005: Enables clean VM shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix error propagation Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « runtime/tests/vm/dart/spawn_infinite_loop_test.dart ('k') | runtime/tests/vm/vm.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:async';
6 import 'dart:isolate';
7
8 // Spawn an isolate |foo| that will continue trying to spawn isolates even after
9 // the timer in |main| completes. This test ensures that the VM can shutdown
10 // correctly even while an isolate is attempting to spawn more isolates.
11
12 isolate1(sendPort) {
13 var receivePort = new ReceivePort();
14 sendPort.send(receivePort.sendPort);
15 receivePort.listen((msg) {});
16 }
17
18 void foo(int count) {
19 for (int i = 0; i < count; i++) {
20 var receivePort = new ReceivePort();
21 Isolate.spawn(isolate1, receivePort.sendPort);
22 receivePort.listen((sendPort) {
23 Isolate.spawn(isolate1,sendPort);
24 receivePort.close();
25 });
26 }
27 }
28
29 void main() {
30 Isolate.spawn(foo, 100);
31 new Timer(const Duration(seconds: 10), () {});
32 }
OLDNEW
« no previous file with comments | « runtime/tests/vm/dart/spawn_infinite_loop_test.dart ('k') | runtime/tests/vm/vm.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698