BitSharper.Threading.Locks.ReentrantLock.Sync.GetHold C# (CSharp) Method

GetHold() protected method

protected GetHold ( Thread caller ) : bool
caller Thread
return bool
            protected bool GetHold(Thread caller)
            {
                if (_owner == null)
                {
                    _owner = caller;
                    _holds = 1;
                    return true;
                }
                if (caller == _owner)
                {
                    var holds = _holds;
                    if (++holds < 0)
                        throw new SystemException("Maximum lock count exceeded");
                    _holds = holds;
                    return true;
                }
                return false;
            }