Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6d8d72b

Browse files
committed
CSHARP-5349: Added missing read lock.
1 parent 6f5bfef commit 6d8d72b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

‎src/MongoDB.Bson/Serialization/BsonSerializer.cs‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,17 @@ internal static IDiscriminatorConvention GetOrRegisterDiscriminatorConvention(Ty
302302
}
303303

304304
internal static bool IsDiscriminatorConventionRegisteredAtThisLevel(Type type)
305-
=> __discriminatorConventions.ContainsKey(type);
305+
{
306+
__configLock.EnterReadLock();
307+
try
308+
{
309+
return __discriminatorConventions.ContainsKey(type);
310+
}
311+
finally
312+
{
313+
__configLock.ExitReadLock();
314+
}
315+
}
306316

307317
/// <summary>
308318
/// Returns whether the given type has any discriminators registered for any of its subclasses.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /