Skip to content

Commit 7a9796a

Browse files
committed
addressed code review remarks.
1 parent 24478e8 commit 7a9796a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Driver/Core/MongoServerInstance.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ internal ReplicaSetInformation ReplicaSetInformation
115115
{
116116
get
117117
{
118-
return _serverInfo.ReplicaSetInformation;
118+
lock (_serverInstanceLock)
119+
{
120+
return _serverInfo.ReplicaSetInformation;
121+
}
119122
}
120123
}
121124

@@ -148,7 +151,7 @@ public MongoServerAddress Address
148151
}
149152
internal set
150153
{
151-
lock (_address)
154+
lock (_serverInstanceLock)
152155
{
153156
_address = value;
154157
}
@@ -705,7 +708,7 @@ private void StateVerificationTimerCallback()
705708
}
706709
}
707710

708-
/// <remarks>This method must be raised outside of a lock.</remarks>
711+
/// <remarks>This method must be called outside of a lock.</remarks>
709712
private void SetState(MongoServerState newState, ServerInformation newServerInfo)
710713
{
711714
bool raiseChangedEvent = false;

0 commit comments

Comments
 (0)