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

Side by Side Diff: tests/coroutine/fiber_yield_channel_receive_test.dart

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 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 | « tests/coroutine/fiber_join_test.dart ('k') | tests/coroutine/fiber_yield_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 // Test that fibers that are blocked in a receive on a channel wake up 5 // Test that fibers that are blocked in a receive on a channel wake up
6 // when there are messages on that channel. 6 // when there are messages on that channel.
7 7
8 import 'dart:fletch'; 8 import 'dart:dartino';
9 9
10 import 'package:isolate/isolate.dart'; 10 import 'package:isolate/isolate.dart';
11 11
12 main() { 12 main() {
13 var channel = new Channel(); 13 var channel = new Channel();
14 var initPort = new Port(channel); 14 var initPort = new Port(channel);
15 var isolate = Isolate.spawn(() => worker(initPort)); 15 var isolate = Isolate.spawn(() => worker(initPort));
16 var port = channel.receive(); 16 var port = channel.receive();
17 for (int i = 0; i < 10; i++) { 17 for (int i = 0; i < 10; i++) {
18 port.send(1); 18 port.send(1);
(...skipping 10 matching lines...) Expand all
29 while (running) { 29 while (running) {
30 Fiber.yield(); 30 Fiber.yield();
31 } 31 }
32 }); 32 });
33 while (running) { 33 while (running) {
34 var msg = channel.receive(); 34 var msg = channel.receive();
35 if (msg == 0) running = false; 35 if (msg == 0) running = false;
36 Fiber.yield(); 36 Fiber.yield();
37 } 37 }
38 } 38 }
OLDNEW
« no previous file with comments | « tests/coroutine/fiber_join_test.dart ('k') | tests/coroutine/fiber_yield_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698