interruptExecution
We cannot use Thread.interrupt here because we have no way to control the code user executes. Thread.interrupt will do nothing for the simple calculation (like while (true) 1
). Consider replacing with something smarter in the future.