jellyfin/Emby.Server.Implementations/IO/SharpCifs/Util/Sharpen/ReentrantLock.cs

23 lines
282 B
C#
Raw Normal View History

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