DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

ATOMIC_INT_ALLOC(D3)


ATOMIC_INT_ALLOC -- allocate an ATOMIC_INT structure

Synopsis

   #include <sys/types.h>
   #include <sys/kmem.h>
   #include <sys/ksynch.h>
   #include <sys/ddi.h>
   

atomic_int_t *ATOMIC_INT_ALLOC(int flag);

Description

ATOMIC_INT_ALLOC allocates an atomic_int_t object. If flag is set to KM_SLEEP, the caller blocks if necessary until the required memory is available. If flag is set to KM_NOSLEEP, the caller does not block, but ATOMIC_INT_ALLOC returns NULL if the memory is not immediately available.

Arguments


flag
Specifies whether the caller is willing to sleep waiting for memory.

Return values

Upon successful completion, ATOMIC_INT_ALLOC( ) returns a pointer to the newly allocated ATOMIC_INT object. If KM_NOSLEEP is specified and sufficient memory is not immediately available, ATOMIC_INT_ALLOC( ) returns a NULL pointer.

Usage

The ATOMIC_INT(D4) object returned must be initialized by ATOMIC_INT_INIT(D3) before it is used.

Context and synchronization

If flag is set to KM_NOSLEEP, non-blockable, initialization, or interrupt context.

If flag is set to KM_SLEEP, user context.

Hardware applicability

All

Version applicability

ddi: 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

References

ATOMIC_INT(D4), ATOMIC_INT_ADD(D3), ATOMIC_INT_DEALLOC(D3), ATOMIC_INT_DECR(D3), ATOMIC_INT_INCR(D3), ATOMIC_INT_INIT(D3), ATOMIC_INT_READ(D3), ATOMIC_INT_SUB(D3), ATOMIC_INT_WRITE(D3)

``Atomic locks'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005