public async Task Invalidate() { using (await valueLock.LockAsync().ConfigureAwait(false)) { _value = default; } }
public async Task Invalidate(CancellationToken cancellationToken = default) { using (await _valueLock.LockAsync(cancellationToken).ConfigureAwait(false)) { _value = default; } }
public async Task <T> Value() { using (await valueLock.LockAsync().ConfigureAwait(false)) { if (IsValueCreatedInternal) { return(_value.Result); } _value = await _valueProvider(_value).ConfigureAwait(false); return(_value.Result); } }
public async Task <T> Value(CancellationToken cancellationToken = default) { using (await _valueLock.LockAsync(cancellationToken).ConfigureAwait(false)) { if (IsValueCreatedInternal) { return(_value.Result); } _value = await _valueProvider(_value).ConfigureAwait(false); return(_value.Result); } }