RFR: 8332084: Ensure JdkConsoleImpl.restoreEcho visibility in a shutdown hook [v4]

Pavel Rappo prappo at openjdk.org
Tue May 14 14:08:03 UTC 2024


On Tue, 14 May 2024 13:32:39 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> I thought of the same scenario that is certainly possible. Now I am tempted to avoid this race condition altogether by removing checking restoreEcho and always issue echo(true). What do you guys think?

It should be possible to provide something adequate based on atomic primitives. However, it would complicate code. So, let's first clarify the problem that `restoreEcho` is trying to solve: why is it important to restore the echo state upon JVM exit? What would happen if we fail to do that? Can it be demonstrated?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/19184#issuecomment-2110336034


More information about the core-libs-dev mailing list