Skip to content

Commit 08688b8

Browse files
authored
CSHARP-5149: Add lock in MongoUrl.ClearCache (#1359)
1 parent ca588b4 commit 08688b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/MongoDB.Driver/MongoUrl.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,10 @@ public TimeSpan? WTimeout
648648
/// </summary>
649649
public static void ClearCache()
650650
{
651-
__cache.Clear();
651+
lock (__staticLock)
652+
{
653+
__cache.Clear();
654+
}
652655
}
653656

654657
/// <summary>

0 commit comments

Comments
 (0)