On 10/25/2016 12:51 PM, Claes Redestad wrote: > Avoiding AtomicBoolean improves startup and footprint for a sample of > small applications: > > Webrev: http://cr.openjdk.java.net/~redestad/8168640/webrev.01/ > Bug: https://bugs.openjdk.java.net/browse/JDK-8168640
I would generally disagree to avoid Atomics to improve startup. In this case, we always lock on close(), even for a short time. I wonder if using plain Unsafe.compareAndSwap instead of Atomic would be cleaner, instead of introducing performance bugs with synchronized-s. Thanks, -Aleksey