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

@ -185,7 +185,10 @@ namespace ObservableCollections
public bool TryGetValue(T equalValue, [MaybeNullWhen(false)] out T actualValue)
{
return set.TryGetValue(equalValue, out actualValue);
lock(SyncRoot)
{
return set.TryGetValue(equalValue, out actualValue);
}
}
#endif