2017-04-02 00:36:06 +00:00
|
|
|
using System.Threading;
|
|
|
|
|
|
|
|
namespace SharpCifs.Util.Sharpen
|
|
|
|
{
|
|
|
|
internal class ReentrantLock
|
2017-07-08 03:12:21 +00:00
|
|
|
{
|
|
|
|
public void Lock ()
|
|
|
|
{
|
|
|
|
Monitor.Enter (this);
|
|
|
|
}
|
2017-04-02 00:36:06 +00:00
|
|
|
|
2017-07-08 03:12:21 +00:00
|
|
|
public bool TryLock ()
|
|
|
|
{
|
|
|
|
return Monitor.TryEnter (this);
|
|
|
|
}
|
2017-04-02 00:36:06 +00:00
|
|
|
|
2017-07-08 03:12:21 +00:00
|
|
|
public void Unlock ()
|
|
|
|
{
|
|
|
|
Monitor.Exit (this);
|
|
|
|
}
|
|
|
|
}
|
2017-04-02 00:36:06 +00:00
|
|
|
}
|