Add lock to TryGetValue

This commit is contained in:
prozolic 2024-02-24 21:26:54 +09:00
parent 170eecf922
commit 557adc7bce

View File

@ -184,9 +184,12 @@ namespace ObservableCollections
#if !NETSTANDARD2_0 && !NET_STANDARD_2_0 && !NET_4_6
public bool TryGetValue(T equalValue, [MaybeNullWhen(false)] out T actualValue)
{
lock(SyncRoot)
{
return set.TryGetValue(equalValue, out actualValue);
}
}
#endif