Skip to content

Commit 0cc27f5

Browse files
committed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Renci.SshNet/Common/Lock.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ namespace Renci.SshNet.Common
55
{
66
internal sealed class Lock
77
{
8+
private readonly object _lockObject = new object();
9+
810
public bool TryEnter()
911
{
10-
return Monitor.TryEnter(this);
12+
return Monitor.TryEnter(_lockObject);
1113
}
1214

1315
public void Exit()
1416
{
15-
Monitor.Exit(this);
17+
Monitor.Exit(_lockObject);
1618
}
1719
}
1820
}

0 commit comments

Comments
 (0)