On 24/06/2018 4:16 PM, Alan Bateman wrote:
On 23/06/2018 11:11, Peter Levart wrote:
Please review the following tiny change that delays
TerminatingThreadLocal class initialization until the 1st thread that
actually uses thread locals, exits:
http://cr.openjdk.java.net/~plevart/jdk-dev/8205540_TerminatingThreadLocal.opt/webrev.01/
Since JDK-8202788 has been pushed, a hotspot/jdb test started failing:
https://bugs.openjdk.java.net/browse/JDK-8205540
...presumably because it is not expecting so many instructions to be
executed at thread exit. This patch might help silence the test. Even
if it doesn't silence the test, it is a change that delays one class
initialization until it is needed and this is good.
This looks okay. I assume an alternative would have been to change the
test.
Presumably, but this is a much better fix. Termination isn't quite as
fragile as initialization but still best not to introduce unnecessary
changes. I hadn't noticed this aspect of the new thread-local changes.
Cheers,
David
-Alan