Espacios de nombres
Variantes
Acciones

atomic_exchange, atomic_exchange_explicit

De cppreference.com
< c‎ | atomic
Definido en la cabecera <stdatomic.h>
C atomic_exchange( volatile A* obj, C desired );
(1) (desde C11)
C atomic_exchange_explicit( volatile A* obj, C desired, memory_order order );
(2) (desde C11)

Atomically replaces the value pointed by obj with desired and returns the value obj held previously. The operation is read-modify-write operation. The first version orders memory accesses according to memory_order_seq_cst, the second version orders memory accesses according to order.

Este es un función genérica definida para todos los tipos de objetos atómicos. A es el tipo de un objeto atómico, C es del tipo no-atómico correspondiente a A .
Original:
This is a función genérica defined for all atomic object types. A is the type of an atomic object, C is the non-atomic type corresponding to A.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Parámetros

obj -
puntero al objeto atómico modificar
Original:
pointer to the atomic object to modify
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
desired - the value to replace the atomic object with
order -
la sincronización de la memoria de ordenación para esta operación: todos los valores están permitidos
Original:
the memory synchronization ordering for this operation: all values are permitted
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Valor de retorno

El valor que tenía antes ser objeto atómica apuntada por obj .
Original:
The value held previously be the atomic object pointed to by obj.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Ver también

swaps un valor con el objeto de una atómico si el valor antiguo es lo que se espera, si no lee el valor antiguo
Original:
swaps a value with the an atomic object if the old value is what is expected, otherwise reads the old value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función) [editar]
Documentación de C++ para atomic_exchange, atomic_exchange_explicit