We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90510ea commit 85c7895Copy full SHA for 85c7895
src/Renci.SshNet/Common/Lock.cs
@@ -5,16 +5,16 @@ namespace Renci.SshNet.Common
5
{
6
internal sealed class Lock
7
8
- private readonly object _lockObject = new object();
9
-
10
public bool TryEnter()
11
12
- return Monitor.TryEnter(_lockObject);
+#pragma warning disable CA2002 // Do not lock on objects with weak identity
+ return Monitor.TryEnter(this);
+#pragma warning restore CA2002 // Do not lock on objects with weak identity
13
}
14
15
public void Exit()
16
17
- Monitor.Exit(_lockObject);
+ Monitor.Exit(this);
18
19
20
0 commit comments