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