T () { boolean computed = myComputed; T value = myValue; if (computed) { return value; } //noinspection SynchronizeOnThis synchronized (this) { computed = myComputed; value = myValue; if (!computed) { RecursionGuard.StackStamp stamp = RecursionManager.markStack(); value = compute(); if (stamp.mayCacheNow()) { myValue = value; myComputed = true; } } } return value; }