SV_ALLOC(D3) SV_ALLOC(D3)
NAME
SV_ALLOC - allocate and initialize a synchronization variable
SYNOPSIS
#include <sys/kmem.h>
#include <sys/ksynch.h>
#include <sys/ddi.h>
sv_t *SV_ALLOC(int flag);
Arguments
flag Specifies whether the caller is willing to sleep
waiting for memory.
DESCRIPTION
SV_ALLOC dynamically allocates and initializes an instance of
a synchronization variable. If flag is set to KM_SLEEP, the
caller will sleep if necessary until sufficient memory is
available. If flag is set to KM_NOSLEEP, the caller will not
sleep, but SV_ALLOC will return NULL if sufficient memory is
not immediately available.
Return Values
Upon successful completion, SV_ALLOC returns a pointer to the
newly allocated synchronization variable. If KM_NOSLEEP is
specified and sufficient memory is not immediately available,
SV_ALLOC returns a NULL pointer.
USAGE
Level
Base only if flag is set to KM_SLEEP.
Initialization, Base or Interrupt if flag is set to
KM_NOSLEEP.
Synchronization Constraints
May sleep if flag is set to KM_SLEEP.
Driver-defined basic locks and read/write locks may be held
across calls to this function if flag is KM_NOSLEEP but may
not be held if flag is KM_SLEEP.
Driver-defined sleep locks may be held across calls to this
function regardless of the value of flag.
Copyright 1994 Novell, Inc. Page 1
SV_ALLOC(D3) SV_ALLOC(D3)
REFERENCES
SV_BROADCAST(D3), SV_DEALLOC(D3), SV_SIGNAL(D3), SV_WAIT(D3),
SV_WAIT_SIG(D3)
NOTICES
Portability
All processors
Applicability
ddi: 5, 5mp, 6, 6mp, 7, 7mp
Copyright 1994 Novell, Inc. Page 2