public TryLock(object obj) { if (!Monitor.TryEnter(obj)) { return; } this.HasLock = true; this.locked = obj; }