On Wed, 7 Sep 2022 19:48:56 GMT, ExE Boss <d...@openjdk.org> wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Minor formating fixes > > src/jdk.jshell/share/classes/jdk/jshell/execution/LocalExecutionControl.java > line 51: > >> 49: private boolean userCodeRunning = false; >> 50: private ThreadGroup execThreadGroup; >> 51: private Field allStop = null; > > It might be better to use a `VarHandle` for this (as it doesn’t need boxing > or access checks on every access).
According to javadoc VarHandle of static field "effectively ignore the volatile declaration". Volatility of REPL.$Cancel.allStop field is critical for this use case. ------------- PR: https://git.openjdk.org/jdk/pull/10166