It seems like it would be cleaner to use AtomicBoolean for serverReady since you are just checking if it is on or off. Otherwise looks fine.

--Sean

On 01/13/2016 04:23 AM, Xuelei Fan wrote:
Hi,

Please review the intermittently test failure fix.

     http://cr.openjdk.java.net/~xuelei/8146669/webrev.00/

In the updated test case, an integer (createdPorts) is used to count the
server sockets.  Every server socket is created in a new thread.  The
access and update to createdPorts should be synchronized for multiple
threading safe.  Update to use AtomicInteger.getAndIncrement() so that
the access and update to createdPorts is atomic.

Thanks,
Xuelei

Reply via email to