コード例 #1
0
 public async Task <T> GetValueAsync(Func <Task <T> > valueInitializer)
 {
     return(await _semaphore.DoubleCheckedLockAsync <T>(
                () => _value,
                val => val is null,
                async() => _value = await valueInitializer()));
 }