netty5/common
Greg Gibeling 66834bc818 Lazily check for root, avoids unnecessary errors & resources
Motivation:

io.netty.util.internal.PlatformDependent.isRoot() depends on the IS_ROOT field which is filled in during class initialization. This spawns processes and consumes resources, which are not generally necessary to the complete functioning of that class.

Modifications:

This switches the class to use lazy initialization this field inside of the isRoot() method using double-checked locking (http://en.wikipedia.org/wiki/Double-checked_locking).

Result:

The first call to isRoot() will be slightly slower, at a tradeoff that class loading is faster, uses fewer resources and platform errors are avoided unless necessary.
2014-12-05 09:16:26 +01:00
..
src Lazily check for root, avoids unnecessary errors & resources 2014-12-05 09:16:26 +01:00
pom.xml [maven-release-plugin] prepare for next development iteration 2014-10-29 11:48:40 +01:00