- Notifications
You must be signed in to change notification settings - Fork 568
Closed
Labels
Description
For example, the code below triggers a strange exception that instrumentation verification can't diagnose while marking the interface as suspendable solves it.
public class Test { /////////////////////////////////////////////////////////////////////// // Uncomment this to solve the issue /////////////////////////////////////////////////////////////////////// // @Suspendable interface I { void doIt(); } static class C implements I { @Override @Suspendable public void doIt() { try { Fiber.sleep(10); } catch (InterruptedException e) { throw new AssertionError(e); } catch (SuspendExecution suspendExecution) { throw new AssertionError(suspendExecution); } } } static public Integer doAll() throws ExecutionException, InterruptedException { final I i = new C(); Fiber<Integer> increasing = new Fiber<>("INCREASER", new SuspendableCallable<Integer>() { @Override public Integer run() throws SuspendExecution, InterruptedException { Object o = new Object(); try { i.doIt(); } finally { i.doIt(); o.toString(); } return 1; }}).start(); return increasing.get(); } static public void main(String[] args) throws ExecutionException, InterruptedException { doAll(); } }Reactions are currently unavailable