public async Task Invalidate() { await _syncLock.WaitAsync().ConfigureAwait(false); _value = default(ExpirationMetadata <T>); _syncLock.Release(); }
public async Task <T> Value() { await _syncLock.WaitAsync().ConfigureAwait(false); try { if (IsValueCreatedInternal) { return(_value.Result); } var result = await _valueProvider(_value).ConfigureAwait(false); _value = result; return(_value.Result); } finally { _syncLock.Release(); } }