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

23 lines
363 B
C#
Raw Normal View History

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