initialize a spin lock
cc [options] -Kthread file
int _spin_init(spin_t *lock, void *arg);
pointer to spin lock to be initialized
NULL (reserved for future use)
_spin_init initializes the spin lock pointed to by lock
to the unlocked state.
Once initialized, the spin lock can be used any number of times without
lock points to the spin lock to be initialized.
arg should be set to NULL.
It is not currently used, but is reserved for future use.
Static spin lock initialization
In this implementation,
a spin lock can be initialized statically
if its storage is zero-filled.
In this case,
_spin_init need not be called.
_spin_init returns zero for success
and an error number for failure.
If any the following conditions is detected,
_spin_init returns the corresponding value:
invalid argument specified
Spin locks should not be used on a single processor system.
In the best case, a spin lock on a single processor system will waste resources,
slowing down the owner of the lock;
in the worst case, it will deadlock the processor.
_spin_init does not examine the lock argument
before initializing it.
If _spin_init is called more than once for the same spin lock,
it will overwrite its state.
It is the user's responsibility to ensure that _spin_init
is only called once for each spin lock.
Operations on locks initialized with
_spin_init are not recursive--a thread can deadlock if
it attempts to relock a spin lock that it already has locked.
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004