strange termination of program with isolates #7701
Labels
area-vm
Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends.
closed-obsolete
Closed as the reported issue is no longer relevant
This issue was originally filed by kguggisberg...@gmail.com
What steps will reproduce the problem?
library clock;
import "dart:isolate";
clock() {
int i=0;
tick() {
print("tick ...");
i++;
if (i == 2)return;
new Timer(1000, (timer) => tick());
}
new Timer(1000, (timer) => tick());
}
main() {
spawnFunction(clock);
}
This programs terminates immediately. It doesn't print anything
to the console.
the end of main()):
library clock;
import "dart:isolate";
clock() {
int i=0;
tick() {
print("tick ...");
i++;
if (i == 2)return;
new Timer(1000, (timer) => tick());
}
new Timer(1000, (timer) => tick());
}
main() {
spawnFunction(clock);
// could be var 'p = port', or 'port.receive(null)' or any other
// expression including receive port 'port'
port;
}
This program prints
tick ...
tick ...
to the console and doesn't terminate.
What is the expected output? What do you see instead?
It's strange that there has to be an explicit reference to 'port'
only to keep the main isolate alive.
What version of the product are you using? On what operating system?
Please provide any additional information below.
The text was updated successfully, but these errors were encountered: