我是javaflow的新手。考虑以下基本示例:
class MyRunnable implements Runnable {
public void run() {
System.out.println("started!");
for( int i=0; i<10; i++ )
echo(i);
}
private void echo(int x) {
System.out.println(x);
Continuation.suspend();
}
}
Continuation c = Continuation.startWith(new MyRunnable());
Continuation d = Continuation.continueWith(c);
Continuation e = Continuation.continueWith(d);
Continuation f = Continuation.continueWith(d);
if (e.equals(f)) System.out.println("They are equal!");
else System.out.println("They are not equal!");
延续 e 和 f 都从相同的检查点 (d) 开始并捕获相同的堆栈,并且它们都打印 1。那么为什么“它们不相等!”?(程序给出这个输出)。有人可以向我解释一下吗?