OLD | NEW |
1 // Copyright (c) 2015, the Fletch 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:fletch'; |
9 | 9 |
10 import 'package:isolate/isolate.dart'; | 10 import 'package:isolate/isolate.dart'; |
11 | 11 |
(...skipping 17 matching lines...) Expand all Loading... |
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 } |
OLD | NEW |