On 04/05/2013 20:05, Xueming Shen wrote:
:

Another sync need is for the "init()", in which it may update the aliasMap,
classMap and aliasNameMap via charset() and deleteCharset() if those
special properties are defined. There are two sources for the charset()/
deleteCharset(), one is from the constructor, one is from the init(), given ExtendedCharsets is now singleton and get initialized at class init, these
should be no race concern between these two sources, so no need to
have any sync block inside charset() and deleteCharset(), the only thing
need to defend is inside init(), and all three public methods invoke the
init() at the beginning of the method body.

One question on this. What would be the downside be doing all the initialization in ExtendedCharsets's constructor instead of two phases? Aside from availableCharsets then I would expect that all other usages would require the mappings to be setup.

-Alan.

Reply via email to