# _xend

Specifies the end of a restricted transactional memory (RTM) code region. The corresponding Intel® AVX2 instruction is XEND.

## Syntax

void _xend(void);

## Arguments

None.

## Description

Specifies the end of restricted transactional memory code region. If this is the outermost transaction (including this `xend` instruction, the number of `xbegin` matches the number of `xend` instructions) then the processor will attempt to commit processor state automatically.

If the commit fails, the processor will rollback all register and memory updates performed during the RTM execution.

The logical processor will resume execution at the fallback address computed from the outermost `xbegin` instruction. The EAX register is updated to reflect RTM abort information. When `xend` is executed outside a transaction will cause a general protection fault (#GP).

The model instruction sequence for `xend` support is:

    __inline void _xend() {
      __asm { xend }
    }

## Returns

Result of the query.

Parent topic: Intrinsics for Restricted Transactional Memory Operations