Merge pull request #31 from prozolic/pullreq

Add lock to ObservableHashSet.TryGetValue
This commit is contained in:
Yoshifumi Kawai 2024-02-27 05:29:17 +09:00 committed by GitHub
commit 20a1c35ecb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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