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

ATOMIC_INT_INIT(D3)


ATOMIC_INT_INIT -- initialize an ATOMIC_INT object

Synopsis

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

void ATOMIC_INT_INIT(atomic_int_t *counter, int value);

Description

ATOMIC_INT_INIT( ) initializes an ATOMIC_INT(D4) object for later use. As part of the initialization, the integer value within the object referenced by counter is initialized to value.

Arguments


counter
Points to an ATOMIC_INT object to be initialized.

value
The value to store into the contents of counter.

Return values

None.

Usage

The ATOMIC_INT(D4) object pointed to by counter must have been previously allocated by ATOMIC_INT_ALLOC(D3).

ATOMIC_INT_INIT may be called multiple times for a single object. However, the driver must serialize these calls by its own means (for example, by using sleep locks). See ``Atomic locks'' in HDK Technical Reference.

Warnings

Unlike ATOMIC_INT_WRITE, ATOMIC_INT_INIT does not serialize with any other operation on ATOMIC_INT objects (that is, it is not atomic).

Context and synchronization

All contexts.

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_ALLOC(D3), ATOMIC_INT_DEALLOC(D3), ATOMIC_INT_DECR(D3), ATOMIC_INT_INCR(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