Re: RFR JDK-8155005: java.lang.reflect.Module.WeakSet is not thread-safe

2016-04-26 Thread Peter Levart
On 04/26/2016 04:56 PM, Alan Bateman wrote: On 26/04/2016 15:42, Peter Levart wrote: I increased the timeout to 30 seconds. It is not exactly 30 seconds, but 300 iterations with sleep(100L) + check in each iteration. If the system is really overloaded then this loop should stretch automatic

Re: RFR JDK-8155005: java.lang.reflect.Module.WeakSet is not thread-safe

2016-04-26 Thread Alan Bateman
On 26/04/2016 15:42, Peter Levart wrote: I increased the timeout to 30 seconds. It is not exactly 30 seconds, but 300 iterations with sleep(100L) + check in each iteration. If the system is really overloaded then this loop should stretch automatically: http://cr.openjdk.java.net/~plevart/jdk

Re: RFR JDK-8155005: java.lang.reflect.Module.WeakSet is not thread-safe

2016-04-26 Thread Peter Levart
Hi Alan, On 04/25/2016 02:58 PM, Alan Bateman wrote: On 25/04/2016 12:13, Peter Levart wrote: Hi Alan, I created an issue for this: JDK-8155005: java.lang.reflect.Module.WeakSet is not thread-safe https://bugs.openjdk.java.net/browse/JDK-8155005 I did what you suggested, renamed

Re: java.lang.reflect.Module.WeakSet is not thread-safe

2016-04-21 Thread Peter Levart
On 04/21/2016 06:07 PM, Peter Levart wrote: I propose to add a thread-safe WeakPairMap data structure which associates a pair of weakly-reachable keys with a strongly-reachable value based on ConcurrentHashMap. Such data structure is footprint-friendly, since only a single instance exists for

java.lang.reflect.Module.WeakSet is not thread-safe

2016-04-21 Thread Peter Levart
Hi, While browsing code in java.lang.reflect.Module (I sometimes do that just to see how thinks work ;-) I stumbled on the following nested class: private static class WeakSet { private final ReadWriteLock lock = new ReentrantReadWriteLock(); private final Lock readLock = l