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

LOCK_OWNED(D3)


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);

Description

Determine if a lock is owned by the calling context.

Arguments


lock
Lock to test for ownership.

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.

Context and synchronization

Non-blockable, user, or blockable context.

Hardware applicability

All

Version applicability

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

References

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