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;
}