Panther Search Documentation Tutorials Devlogs Downloads Source Code

Documentation > Panther Documentation > Intrinsics > @atomicRMW

@atomicRMW

Panther
Documentation


1: func @atomicRMW = <{TARGET: Type, VALUE: Type, OP: @pthr.AtomicRMWOp, ORDER: @pthr.AtomicOrdering}> (target: TARGET, value: VALUE in) -> VALUE;

  Atomic read-modify-write operation.

Template Parameters

  TARGET: must be a non-optional pointer, and is a pointer to the type of value to store to

  VALUE: must be the result of a dereference of TARGET

  OP: specific atomic read-modify-write operation to perform

  ORDER: Atomic memory order for the operation

Parameters

  target: target to operate read-modify-write operation on

  value: value to operate with

Return Value

  Returns the value value loaded before selected read-modify-write operation OP.

Example

(TODO)

See Also

@atomicLoad Atomically load a value
@atomicStore Atomically store a value
@cmpxchg Atomic compare-exchange