Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8332084: Ensure JdkConsoleImpl.restoreEcho visibility in a shutdown hook #19184

Closed
wants to merge 12 commits into from
12 changes: 7 additions & 5 deletions src/java.base/share/classes/jdk/internal/io/JdkConsoleImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ private void installShutdownHook() {
false /* only register if shutdown is not in progress */,
new Runnable() {
public void run() {
try {
if (restoreEcho) {
echo(true);
}
} catch (IOException x) { }
synchronized(readLock) {
try {
if (restoreEcho) {
echo(true);
}
} catch (IOException _) { }
}
}
});
} catch (IllegalStateException e) {
naotoj marked this conversation as resolved.
Show resolved Hide resolved
Expand Down