1 implementation of IAsyncLocal
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (1)
12public sealed class AsyncLocal<T> : IAsyncLocal
65 references to IAsyncLocal
System.Private.CoreLib (65)
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (53)
49void IAsyncLocal.OnValueChanged(object? previousValueObj, object? currentValueObj, bool contextChanged) 93bool TryGetValue(IAsyncLocal key, out object? value); 94IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent); 110public static IAsyncLocalValueMap Create(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 122public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 131public bool TryGetValue(IAsyncLocal key, out object? value) 141private readonly KeyValuePair<IAsyncLocal, object?> _item0; 143public OneElementAsyncLocalValueMap(KeyValuePair<IAsyncLocal, object?> item0) 148public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 154KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 169public bool TryGetValue(IAsyncLocal key, out object? value) 187private readonly KeyValuePair<IAsyncLocal, object?> _item0; 188private readonly KeyValuePair<IAsyncLocal, object?> _item1; 191KeyValuePair<IAsyncLocal, object?> item0, 192KeyValuePair<IAsyncLocal, object?> item1) 198public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 204KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 221public bool TryGetValue(IAsyncLocal key, out object? value) 244private readonly KeyValuePair<IAsyncLocal, object?> _item0; 245private readonly KeyValuePair<IAsyncLocal, object?> _item1; 246private readonly KeyValuePair<IAsyncLocal, object?> _item2; 249KeyValuePair<IAsyncLocal, object?> item0, 250KeyValuePair<IAsyncLocal, object?> item1, 251KeyValuePair<IAsyncLocal, object?> item2) 258public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 264KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 283public bool TryGetValue(IAsyncLocal key, out object? value) 311private readonly KeyValuePair<IAsyncLocal, object?> _item0; 312private readonly KeyValuePair<IAsyncLocal, object?> _item1; 313private readonly KeyValuePair<IAsyncLocal, object?> _item2; 314private readonly KeyValuePair<IAsyncLocal, object?> _item3; 317KeyValuePair<IAsyncLocal, object?> item0, 318KeyValuePair<IAsyncLocal, object?> item1, 319KeyValuePair<IAsyncLocal, object?> item2, 320KeyValuePair<IAsyncLocal, object?> item3) 328public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 333KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 354public bool TryGetValue(IAsyncLocal key, out object? value) 388private readonly KeyValuePair<IAsyncLocal, object?>[] _keyValues; 390internal MultiElementAsyncLocalValueMap(KeyValuePair<IAsyncLocal, object?>[] keyValues) 396public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 407KeyValuePair<IAsyncLocal, object?>[] newValues = _keyValues.AsSpan().ToArray(); 428var newValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length - 1]; 448var newValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length + 1]; 456foreach (KeyValuePair<IAsyncLocal, object?> pair in _keyValues) 464public bool TryGetValue(IAsyncLocal key, out object? value) 466foreach (KeyValuePair<IAsyncLocal, object?> pair in _keyValues) 480private sealed class ManyElementAsyncLocalValueMap : Dictionary<IAsyncLocal, object?>, IAsyncLocalValueMap 484public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 494foreach (KeyValuePair<IAsyncLocal, object?> pair in this) 513var newValues = new KeyValuePair<IAsyncLocal, object?>[MultiElementAsyncLocalValueMap.MaxMultiElements]; 515foreach (KeyValuePair<IAsyncLocal, object?> pair in this) 528foreach (KeyValuePair<IAsyncLocal, object?> pair in this)
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (12)
26private readonly IAsyncLocal[]? m_localChangeNotifications; 37IAsyncLocal[]? localChangeNotifications, 90(s_defaultFlowSuppressed ??= new ExecutionContext(AsyncLocalValueMap.Empty, new IAsyncLocal[0], isFlowSuppressed: true)) : 360IAsyncLocal[]? previousChangeNotifications = previousExecutionCtx?.m_localChangeNotifications; 361IAsyncLocal[]? nextChangeNotifications = nextExecutionCtx?.m_localChangeNotifications; 375foreach (IAsyncLocal local in previousChangeNotifications) 389foreach (IAsyncLocal local in nextChangeNotifications) 409foreach (IAsyncLocal local in previousChangeNotifications) 423foreach (IAsyncLocal local in nextChangeNotifications!) 448internal static object? GetLocalValue(IAsyncLocal local) 462internal static void SetLocalValue(IAsyncLocal local, object? newValue, bool needChangeNotifications) 488IAsyncLocal[]? newChangeNotifications = null;