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

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

Issue 1275353005: VM thread shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
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++) {
Ivan Posva 2015/08/17 13:35:51 We should just continuously be spawning isolates a
zra 2015/08/18 06:23:14 Done.
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

Powered by Google App Engine
This is Rietveld 408576698