private void TakeLocks(ref bool thisLockTaken, ref bool sessionHandleLockTaken)
{
Debug.Assert(_thisLock != null, "'_thisLock' MUST NOT be NULL.");
Debug.Assert(SessionHandle != null, "'SessionHandle' MUST NOT be NULL.");
Monitor.Enter(SessionHandle, ref sessionHandleLockTaken);
Monitor.Enter(_thisLock, ref thisLockTaken);
}