Standard C Library Functions atomicswap(3C)
NAME
atomicswap, atomicswap8, atomicswapuchar,
atomicswap16, atomicswapushort, atomicswap32,
atomicswapuint, atomicswapulong, atomicswap64,
atomicswapptr - atomic swap operations
SYNOPSIS
#include
uint8t atomicswap8(volatile uint8t *target, uint8t newval);
uchart atomicswapuchar(volatile uchart *target, uchart newval);
uint16t atomicswap16(volatile uint16t *target, uint16t newval);
ushortt atomicswapushort(volatile ushortt *target, ushortt newval);
uint32t atomicswap32(volatile uint32t *target, uint32t newval);
uintt atomicswapuint(volatile uintt *target, uintt newval);
ulongt atomicswapulong(volatile ulongt *target, ulongt newval);
uint64t atomicswap64(volatile uint64t *target, uint64t newval);
void *atomicswapptr(volatile void *target, void *newval);
DESCRIPTION
These functions enable a swap operation to occur atomically.
The value stored in target is replaced with newval. The old
value is returned by the function.
RETURN VALUES
These functions return the old of *target.
ERORS
No errors are defined.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
SunOS 5.11 Last change: 13 May 2005 1
Standard C Library Functions atomicswap(3C)
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Stable
MT-Level MT-Safe
SEE ALSO
atomicadd(3C), atomicand(3C), atomicbits(3C),
atomicdec(3C), atomicinc(3C), atomicor(3C),
atomiccas(3C), membarops(3C), attributes(5),
atomicops(9F)
SunOS 5.11 Last change: 13 May 2005 2
|