AFAIK double-checking in Java only works if variable is volatile.
I will double-check (pun unintended) but as far as I know double-checked locks are safe for integers (32-bit int) and always have been with or without volatile.
Oh, an static fields with no volatile are not guaranteed to be initialized when another thread accesses class. Probably should be fixed as a part of this CL as well.
Really? That's a surprise to me.
|