名前空間
変種
操作

atomic_exchange, atomic_exchange_explicit

提供: cppreference.com
< c‎ | atomic

Defined in header <stdatomic.h>
C atomic_exchange( volatile A* obj, C desired );
(1)
C atomic_exchange_explicit( volatile A* obj, C desired, memory_order order );
(2)

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.

これは、すべての原子オブジェクト·タイプに対して定義汎用関数です。 Aアトミックオブジェクトの型である、CAに対応する非原子型で.
Original:
This is a 汎用関数 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.

[編集] パラメータ

obj -
変更するアトミックオブジェクトへのポインタ
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 -
メモリ同期は、この操作の順序:すべての値が許可されています
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.

[編集] 値を返します

値は、以前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.

[編集] も参照してください

スワップはアトミックオブジェクトと値は古い値が期待されているか、そうでない場合は、古い値を読み込みます
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.

(機能) [edit]
C++ documentation for atomic_exchange, atomic_exchange_explicit