Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 7/13/2023
Public
Document Table of Contents

HLE Acquire _InterlockedCompareExchange Functions

Performs an atomic compare-and-exchange operation on the specified values and attempts to begin a HLE transaction if supported by the executing platform. This intrinsic function applies to C/C++ applications for Windows only.

Syntax

long _InterlockedCompareExchange_HLEAcquire(long volatile *Destination, long Exchange, long Comparand);

__int64 _InterlockedCompareExchange64_HLEAcquire(__int64 volatile *Destination, __int64 Exchange, __int64 Comparand);

void * _InterlockedCompareExchangePointer_HLEAcquire(void * volatile *Destination, void * Exchange, void * Comparand);

Parameters

Destination [in, out]

pointer to the destination value

Exchange [in]

value which will be written at Destination if the comparison matches.

Comparand [in]

value to compare to the value referenced by Destination.

Description

Performs an atomic compare-and-exchange operation on the specified values, and also attempts to begin a HLE transaction if the executing platform supports it.

These functions compare two specified values and replaces one of them with a third value if the compared values are equal.

Returns

Returns the initial value referenced by the Destination parameter.