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

23 lines
363 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-06-20 23:46:57 -07:00
{
public void Lock()
{
Monitor.Enter(this);
}
2017-04-01 17:36:06 -07:00
2017-06-20 23:46:57 -07:00
public bool TryLock()
{
return Monitor.TryEnter(this);
}
2017-04-01 17:36:06 -07:00
2017-06-20 23:46:57 -07:00
public void Unlock()
{
Monitor.Exit(this);
}
}
2017-04-01 17:36:06 -07:00
}