RFR 8012326: Deadlock occurs when Charset.availableCharsets() is called by several threads at the same time
Alan.Bateman at oracle.com
Fri May 3 14:18:53 UTC 2013
On 03/05/2013 05:29, Xueming Shen wrote:
> An alternative is to really implement the singleton pattern in ECP,
> given the existing mechanism we have in Charset.java and the "hacky"
> implementation we need in ECP, I go with the current approach.
I'm not sure that I understand your comment, are you saying that the
initialize-on-demand holder idiom wouldn't work here? I would think it
should make it simpler and easier to understand.
For the ISO2022_JP_2 and MSISO2022JP then they probably don't need to be
volatile. As it stands then the fields may get written more than once
(which is harmless).
More information about the core-libs-dev