On Tue, 21 May 2024 22:51:14 GMT, Naoto Sato <na...@openjdk.org> wrote:
>> Making sure `restoreEcho` correctly reflects the state in the shutdown >> thread, which differs from the application's thread that issues the >> `readPassword()` method. > > Naoto Sato has updated the pull request incrementally with one additional > commit since the last revision: > > Used a dedicate lock for restoreEcho Based on an internal discussion regarding Stuart's above comment, I changed the `restoreEcho` field back to the original. Instead of making it volatile, synchronizing it with a dedicated lock would ensure visibility and atomic status updates (no races). ------------- PR Comment: https://git.openjdk.org/jdk/pull/19184#issuecomment-2123561717