20 namespace Lucene.Net.Store
37 private System.Collections.Generic.HashSet<
string> locks =
new System.Collections.Generic.HashSet<
string>();
39 public override Lock MakeLock(System.String lockName)
47 public override void ClearLock(System.String lockName)
51 if (locks.Contains(lockName))
53 locks.Remove(lockName);
63 internal System.String lockName;
64 private System.Collections.Generic.HashSet<
string> locks;
66 public SingleInstanceLock(System.Collections.Generic.HashSet<
string> locks, System.String lockName)
69 this.lockName = lockName;
72 public override bool Obtain()
76 if (locks.Contains(lockName) ==
false)
86 public override void Release()
90 locks.Remove(lockName);
94 public override bool IsLocked()
98 return locks.Contains(lockName);
102 public override System.String ToString()
104 return base.
ToString() +
": " + lockName;