Standard C Library Functions atomiccas(3C)
NAME
atomiccas, atomiccas8, atomiccasuchar, atomiccas16,
atomiccasushort, atomiccas32, atomiccasuint,
atomiccasulong, atomiccas64, atomiccasptr - atomic
compare and swap operations
SYNOPSIS
#include
uint8t atomiccas8(volatile uint8t *target, uint8t cmp,
uint8t newval);
uchart atomiccasuchar(volatile uchart *target, uchart cmp,
uchart newval);
uint16t atomiccas16(volatile uint16t *target, uint16t cmp,
uint16t newval);
ushortt atomiccasushort(volatile ushortt *target, ushortt cmp,
ushortt newval);
uint32t atomiccas32(volatile uint32t *target, uint32t cmp,
uint32t newval);
uintt atomiccasuint(volatile uintt *target, uintt cmp,
uintt newval);
ulongt atomiccasulong(volatile ulongt *target, ulongt cmp,
ulongt newval);
uint64t atomiccas64(volatile uint64t *target, uint64t cmp,
uint64t newval);
void *atomiccasptr(volatile void *target, void *cmp,
void *newval);
DESCRIPTION
These functions enable a compare and swap operation to occur
atomically. The value stored in target is compared with cmp.
If these values are equal, the value stored in target is
replaced with newval. The old value stored in target is
returned by the function whether or not the replacement
occurred.
SunOS 5.11 Last change: 13 May 2005 1
Standard C Library Functions atomiccas(3C)
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:
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),
atomicswap(3C), membarops(3C), attributes(5),
atomicops(9F)
SunOS 5.11 Last change: 13 May 2005 2
|