T (AccessorParameter a, Owner owner, Parameter p) { r.lock(); T result; try { result = getValue(owner, a); } finally { r.unlock(); } if (result == null) { w.lock(); try { result = getValue(owner, a); if (result == null) { RecursionGuard.StackStamp stamp = RecursionManager.markStack(); result = compute(owner, p); if (stamp.mayCacheNow()) { putValue(result, owner, a); } } } finally { w.unlock(); } } return result; }