public bool TryLock(Duration timeout) { WritePreamble(); if (timeout == Duration.Automatic) { throw new ArgumentOutOfRangeException("timeout"); } return LockImpl(timeout); }