NAME
atomic_load_int
,
atomic_load_long
,
atomic_store_long
,
atomic_store_int
—
atomic read and write memory
operations
SYNOPSIS
#include
<sys/atomic.h>
unsigned int
atomic_load_int
(volatile
unsigned int *p);
unsigned long
atomic_load_long
(volatile
unsigned long *p);
void
atomic_store_int
(volatile
unsigned int *p, unsigned
int v);
void
atomic_store_long
(volatile
unsigned long *p,
unsigned long v);
DESCRIPTION
The atomic_load and atomic_store set of functions provide an interface for atomically performing read or write memory operations with respect to interrupts and multiple processors in the system.
The atomic_store functions change the value referenced by the pointer p to the value v.
CONTEXT
atomic_load_int
(),
atomic_load_long
(),
atomic_store_int
(), and
atomic_store_long
() can all be called during
autoconf, from process context, or from interrupt context.
RETURN VALUES
atomic_load_int
and
atomic_load_long
return the value at
p.
SEE ALSO
atomic_add_int(9), atomic_add_long(9), atomic_sub_int(9), atomic_sub_long(9)
HISTORY
The atomic_load and atomic_store functions first appeared in OpenBSD 7.1.