LOCK_OWNED(D3) LOCK_OWNED(D3)
NAME
LOCK_OWNED - determine if the current context owns a basic
lock
SYNOPSIS
#include <sys/types.h>
#include <sys/ksynch.h>
#include <sys/ddi.h>
bool_t LOCK_OWNED(lock_t *lock);
Arguments
lock Lock to test for ownership.
DESCRIPTION
Determine if a lock is owned by the calling context.
Return Values
If the driver is compiled with DEBUG, then LOCK_OWNED returns
TRUE if the current context owns the lock and FALSE
otherwise. If the driver is not compiled with DEBUG, then
LOCK_OWNED returns TRUE in all cases.
USAGE
The LOCK_OWNED function is designed to assist in the debugging
of driver code. Production versions of drivers should avoid
calling this function (via use of conditional compilation
under DEBUG).
Warnings
The meaning of the calling context is specific to the
implementation of the operating system kernel. Depending upon
the operating system implementation, when LOCK_OWNED is called
from an interrupt routine, it may or may not return TRUE when
that interrupt routine is not holding the specified lock, but
some underlying level (base or interrupt level) is holding the
lock.
Level
Initialization, Base or Interrupt.
Synchronization Constraints
Driver-defined basic locks, read/write locks, and sleep locks
may be held across calls to this function
Copyright 1994 Novell, Inc. Page 1
LOCK_OWNED(D3) LOCK_OWNED(D3)
REFERENCES
LOCK(D3), KS_HOLD0LOCKS(D3), UNLOCK(D3)
NOTICES
Portability
All processors
Applicability
ddi: 5, 5mp, 6, 6mp, 7, 7mp
Copyright 1994 Novell, Inc. Page 2