public override void LockInterruptibly() { Thread caller = Thread.CurrentThread; lock (this) { if (_owner == null) { _owner = caller; _holds = 1; return; } else if (caller == _owner) { ++_holds; return; } } WaitNode n = new WaitNode(); n.DoWait(this); }
public override void LockInterruptibly() { Thread caller = Thread.CurrentThread; lock (this) { if (GetHold(caller)) return; } WaitNode n = new WaitNode(); n.DoWait(this); }