xtd 0.2.0
Loading...
Searching...
No Matches
xtd::native::interlocked Class Referencefinal

Definition

Contains interlocked native API.

Namespace
xtd::native
Library
xtd.core.native
Warning
Internal use only

Protected Static Methods

static int32_t add (int32_t &location, int32_t value)
 Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation.
 
static int64_t add (int64_t &location, int64_t value)
 Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation.
 
static int32_t compare_exchange (int32_t &location, int32_t value, int32_t comparand)
 Compares two 32-bit signed integers for equality and, if they are equal, replaces one of the values.
 
static int64_t compare_exchange (int64_t &location, int64_t value, int64_t comparand)
 Compares two 64-bit signed integers for equality and, if they are equal, replaces one of the values.
 
static __slong__ compare_exchange (__slong__ &location, __slong__ value, __slong__ comparand)
 Compares two slong signed integers for equality and, if they are equal, replaces one of the values.
 
static void * compare_exchange (void *&location, void *value, void *comparand)
 Compares two platform-specific handles or pointers for equality and, if they are equal, replaces one of them.
 
static int32_t decrement (int32_t &location)
 Decrements a specified variable and stores the result, as an atomic operation.
 
static int64_t decrement (int64_t &location)
 Decrements a specified variable and stores the result, as an atomic operation.
 
static int32_t exchange (int32_t &location, int32_t value)
 Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation.
 
static int64_t exchange (int64_t &location, int64_t value)
 Sets a 64-bit signed integer to a specified value and returns the original value, as an atomic operation.
 
static __slong__ exchange (__slong__ &location, __slong__ value)
 Sets a slong signed integer to a specified value and returns the original value, as an atomic operation.
 
static void * exchange (void *&location, void *value)
 Sets a platform-specific handles or pointers to a specified value and returns the original value, as an atomic operation.
 
static int32_t increment (int32_t &location)
 Increments a specified variable and stores the result, as an atomic operation.
 
static int64_t increment (int64_t &location)
 Increments a specified variable and stores the result, as an atomic operation.
 

Member Function Documentation

◆ add() [1/2]

static int32_t xtd::native::interlocked::add ( int32_t &  location,
int32_t  value 
)
staticprotected

Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation.

Parameters
locationA variable containing the first value to be added. The sum of the two values is stored in location.
valueThe value to be added to the integer at location.
Returns
int32_t The new value stored at location.
Warning
Internal use only

◆ add() [2/2]

static int64_t xtd::native::interlocked::add ( int64_t &  location,
int64_t  value 
)
staticprotected

Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation.

Parameters
locationA variable containing the first value to be added. The sum of the two values is stored in location.
valueThe value to be added to the integer at location.
Returns
int64_t The new value stored at location.
Warning
Internal use only

◆ compare_exchange() [1/4]

static int32_t xtd::native::interlocked::compare_exchange ( int32_t &  location,
int32_t  value,
int32_t  comparand 
)
staticprotected

Compares two 32-bit signed integers for equality and, if they are equal, replaces one of the values.

Parameters
locationThe destination, whose value is compared with Comparand and possibly replaced.
valueThe value that replaces the destination value if the comparison results in equality.
ComparandThe value that is compared to the value at location.
Returns
The original value in location.
Warning
Internal use only

◆ compare_exchange() [2/4]

static int64_t xtd::native::interlocked::compare_exchange ( int64_t &  location,
int64_t  value,
int64_t  comparand 
)
staticprotected

Compares two 64-bit signed integers for equality and, if they are equal, replaces one of the values.

Parameters
locationThe destination, whose value is compared with comparand and possibly replaced.
valueThe value that replaces the destination value if the comparison results in equality.
comparandThe value that is compared to the value at location.
Returns
The original value in location.
Warning
Internal use only

◆ compare_exchange() [3/4]

static __slong__ xtd::native::interlocked::compare_exchange ( __slong__ location,
__slong__  value,
__slong__  comparand 
)
staticprotected

Compares two slong signed integers for equality and, if they are equal, replaces one of the values.

Parameters
locationThe destination, whose value is compared with comparand and possibly replaced.
valueThe value that replaces the destination value if the comparison results in equality.
comparandThe value that is compared to the value at location.
Returns
The original value in location.
Warning
Internal use only

◆ compare_exchange() [4/4]

static void * xtd::native::interlocked::compare_exchange ( void *&  location,
void *  value,
void *  comparand 
)
staticprotected

Compares two platform-specific handles or pointers for equality and, if they are equal, replaces one of them.

Parameters
locationThe destination, whose value is compared with comparand and possibly replaced.
valueThe value that replaces the destination value if the comparison results in equality.
comparandThe value that is compared to the value at location.
Returns
The original value in location.
Warning
Internal use only

◆ decrement() [1/2]

static int32_t xtd::native::interlocked::decrement ( int32_t &  location)
staticprotected

Decrements a specified variable and stores the result, as an atomic operation.

Parameters
locationThe variable whose value is to be decremented.
Returns
The decremented value.
Warning
Internal use only

◆ decrement() [2/2]

static int64_t xtd::native::interlocked::decrement ( int64_t &  location)
staticprotected

Decrements a specified variable and stores the result, as an atomic operation.

Parameters
locationThe variable whose value is to be decremented.
Returns
The decremented value.
Warning
Internal use only

◆ exchange() [1/4]

static int32_t xtd::native::interlocked::exchange ( int32_t &  location,
int32_t  value 
)
staticprotected

Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation.

Parameters
locationThe variable to set to the specified value.
valueThe value to which the location parameter is set.
Returns
The original value of location.
Warning
Internal use only

◆ exchange() [2/4]

static int64_t xtd::native::interlocked::exchange ( int64_t &  location,
int64_t  value 
)
staticprotected

Sets a 64-bit signed integer to a specified value and returns the original value, as an atomic operation.

Parameters
locationThe variable to set to the specified value.
valueThe value to which the location parameter is set.
Returns
The original value of location.
Warning
Internal use only

◆ exchange() [3/4]

static __slong__ xtd::native::interlocked::exchange ( __slong__ location,
__slong__  value 
)
staticprotected

Sets a slong signed integer to a specified value and returns the original value, as an atomic operation.

Parameters
locationThe variable to set to the specified value.
valueThe value to which the location parameter is set.
Returns
The original value of location.
Warning
Internal use only

◆ exchange() [4/4]

static void * xtd::native::interlocked::exchange ( void *&  location,
void *  value 
)
staticprotected

Sets a platform-specific handles or pointers to a specified value and returns the original value, as an atomic operation.

Parameters
locationThe variable to set to the specified value.
valueThe value to which the location parameter is set.
Returns
The original value of location.
Warning
Internal use only

◆ increment() [1/2]

static int32_t xtd::native::interlocked::increment ( int32_t &  location)
staticprotected

Increments a specified variable and stores the result, as an atomic operation.

Parameters
locationThe variable whose value is to be incremented.
Returns
The incremented value.
Warning
Internal use only

◆ increment() [2/2]

static int64_t xtd::native::interlocked::increment ( int64_t &  location)
staticprotected

Increments a specified variable and stores the result, as an atomic operation.

Parameters
locationThe variable whose value is to be incremented.
Returns
The incremented value.
Warning
Internal use only

The documentation for this class was generated from the following file: