You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
282 B
23 lines
282 B
8 years ago
|
using System.Threading;
|
||
|
|
||
|
namespace SharpCifs.Util.Sharpen
|
||
|
{
|
||
|
internal class ReentrantLock
|
||
|
{
|
||
|
public void Lock ()
|
||
|
{
|
||
|
Monitor.Enter (this);
|
||
|
}
|
||
|
|
||
|
public bool TryLock ()
|
||
|
{
|
||
|
return Monitor.TryEnter (this);
|
||
|
}
|
||
|
|
||
|
public void Unlock ()
|
||
|
{
|
||
|
Monitor.Exit (this);
|
||
|
}
|
||
|
}
|
||
|
}
|