1 implementation of IAsyncLocal
System.Private.CoreLib (1)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (1)
14public sealed class AsyncLocal<T> : IAsyncLocal
70 references to IAsyncLocal
System.Private.CoreLib (70)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (58)
51void IAsyncLocal.OnValueChanged(object? previousValueObj, object? currentValueObj, bool contextChanged) 95bool TryGetValue(IAsyncLocal key, out object? value); 96IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent); 112public static IAsyncLocalValueMap Create(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 124public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 133public bool TryGetValue(IAsyncLocal key, out object? value) 143private readonly KeyValuePair<IAsyncLocal, object?> _item0; 145public OneElementAsyncLocalValueMap(KeyValuePair<IAsyncLocal, object?> item0) 150public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 156KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 171public bool TryGetValue(IAsyncLocal key, out object? value) 189private readonly KeyValuePair<IAsyncLocal, object?> _item0; 190private readonly KeyValuePair<IAsyncLocal, object?> _item1; 193KeyValuePair<IAsyncLocal, object?> item0, 194KeyValuePair<IAsyncLocal, object?> item1) 200public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 206KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 223public bool TryGetValue(IAsyncLocal key, out object? value) 246private readonly KeyValuePair<IAsyncLocal, object?> _item0; 247private readonly KeyValuePair<IAsyncLocal, object?> _item1; 248private readonly KeyValuePair<IAsyncLocal, object?> _item2; 251KeyValuePair<IAsyncLocal, object?> item0, 252KeyValuePair<IAsyncLocal, object?> item1, 253KeyValuePair<IAsyncLocal, object?> item2) 260public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 266KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 285public bool TryGetValue(IAsyncLocal key, out object? value) 313private readonly KeyValuePair<IAsyncLocal, object?> _item0; 314private readonly KeyValuePair<IAsyncLocal, object?> _item1; 315private readonly KeyValuePair<IAsyncLocal, object?> _item2; 316private readonly KeyValuePair<IAsyncLocal, object?> _item3; 319KeyValuePair<IAsyncLocal, object?> item0, 320KeyValuePair<IAsyncLocal, object?> item1, 321KeyValuePair<IAsyncLocal, object?> item2, 322KeyValuePair<IAsyncLocal, object?> item3) 330public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 335KeyValuePair<IAsyncLocal, object?> newItem = KeyValuePair.Create(key, value); 356public bool TryGetValue(IAsyncLocal key, out object? value) 390private readonly KeyValuePair<IAsyncLocal, object?>[] _keyValues; 392internal MultiElementAsyncLocalValueMap(KeyValuePair<IAsyncLocal, object?>[] keyValues) 398public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 409KeyValuePair<IAsyncLocal, object?>[] newValues = _keyValues.AsSpan().ToArray(); 430var newValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length - 1]; 450var newValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length + 1]; 457var manyValues = new KeyValuePair<IAsyncLocal, object?>[MaxMultiElements + 1]; 463public bool TryGetValue(IAsyncLocal key, out object? value) 465foreach (KeyValuePair<IAsyncLocal, object?> pair in _keyValues) 481private readonly KeyValuePair<IAsyncLocal, object?>[] _keyValues; 485public ManyElementAsyncLocalValueMap(KeyValuePair<IAsyncLocal, object?>[] keyValues) 504KeyValuePair<IAsyncLocal, object?>[] keyValues, 513public IAsyncLocalValueMap Set(IAsyncLocal key, object? value, bool treatNullValueAsNonexistent) 523KeyValuePair<IAsyncLocal, object?>[] updatedValues = _keyValues.AsSpan().ToArray(); 528var newValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length + 1]; 541var newValues = new KeyValuePair<IAsyncLocal, object?>[MultiElementAsyncLocalValueMap.MaxMultiElements]; 547var remainingValues = new KeyValuePair<IAsyncLocal, object?>[_keyValues.Length - 1]; 558public bool TryGetValue(IAsyncLocal key, out object? value) 571private int FindEntry(IAsyncLocal key) 585private static int GetBucket(IAsyncLocal key, int bucketCount)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (12)
24internal static readonly ExecutionContext DefaultFlowSuppressed = new ExecutionContext(AsyncLocalValueMap.Empty, new IAsyncLocal[0], isFlowSuppressed: true); 28private readonly IAsyncLocal[]? m_localChangeNotifications; 39IAsyncLocal[]? localChangeNotifications, 377IAsyncLocal[]? previousChangeNotifications = previousExecutionCtx?.m_localChangeNotifications; 378IAsyncLocal[]? nextChangeNotifications = nextExecutionCtx?.m_localChangeNotifications; 392foreach (IAsyncLocal local in previousChangeNotifications) 406foreach (IAsyncLocal local in nextChangeNotifications) 426foreach (IAsyncLocal local in previousChangeNotifications) 440foreach (IAsyncLocal local in nextChangeNotifications!) 465internal static object? GetLocalValue(IAsyncLocal local) 479internal static void SetLocalValue(IAsyncLocal local, object? newValue, bool needChangeNotifications) 505IAsyncLocal[]? newChangeNotifications = null;