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