ReentrantLock.cs 282 B

12345678910111213141516171819202122
  1. using System.Threading;
  2. namespace SharpCifs.Util.Sharpen
  3. {
  4. internal class ReentrantLock
  5. {
  6. public void Lock ()
  7. {
  8. Monitor.Enter (this);
  9. }
  10. public bool TryLock ()
  11. {
  12. return Monitor.TryEnter (this);
  13. }
  14. public void Unlock ()
  15. {
  16. Monitor.Exit (this);
  17. }
  18. }
  19. }