RFR: 8340830: Console.readLine() and Console.printf() are mutually blocking

Alan Bateman alanb at openjdk.org
Fri Jan 30 12:25:05 UTC 2026


On Thu, 29 Jan 2026 21:08:06 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> Fixing an issue in Console where write is blocked if other thread is waiting to read, which is caused by unnecessary read/write locks. Removing those would solve the problem, as the read/write synchronization is performed at the StreamEn/Decoder level. One unrelated change is to refactor double-checked locking with LazyConstant.

There is already syncrhonization at the stream level so I think it is okay to do this. Would it be good to have another set of eyes on this too.

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

PR Comment: https://git.openjdk.org/jdk/pull/29493#issuecomment-3823471993


More information about the core-libs-dev mailing list