unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-5.7)
Page:
Section:
Apropos / Subsearch:
optional field

ATOMIC_INC_INT(9)        BSD Kernel Developer's Manual       ATOMIC_INC_INT(9)

NAME
     atomic_inc_int, atomic_inc_int_nv, atomic_inc_long, atomic_inc_long_nv --
     atomic increment operations

SYNOPSIS
     #include <&lt;sys/atomic.h>&gt;

     void
     atomic_inc_int(volatile unsigned int *p);

     unsigned int
     atomic_inc_int_nv(volatile unsigned int *p);

     void
     atomic_inc_long(volatile unsigned long *p);

     unsigned long
     atomic_inc_long_nv(volatile unsigned long *p);

DESCRIPTION
     The atomic_inc set of functions provide an interface for atomically per-
     forming increment and increment-and-fetch operations with respect to
     interrupts and multiple processors in the system.

     The value referenced by the pointer p is incremented by 1.

CONTEXT
     atomic_inc_int(), atomic_inc_int_nv(), atomic_inc_long(), and
     atomic_inc_long_nv() can all be called during autoconf, from process con-
     text, or from interrupt context.

RETURN VALUES
     atomic_inc_int and atomic_inc_long perform the increment without return-
     ing any knowledge of the value at p.

     atomic_inc_int_nv and atomic_inc_long_nv return the value at p after the
     increment was performed.

SEE ALSO
     atomic_add_int(9), atomic_dec_int(9)

HISTORY
     The atomic_inc functions first appeared in NetBSD 5.0 and OpenBSD 5.5.

BSD                            February 13, 2014                           BSD