Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ LOCK(D3DK) — Motorola System V 88k Release 4 Version 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

LOCK(D3DK)  —  

NAME

LOCK − acquire a basic lock .IX \f4LOCK\fP(D3DK)

SYNOPSIS

#include <sys/types.h>
#include <sys/ksynch.h>
pl_t LOCK(lock_t ∗lockp, pl_t pl);

ARGUMENTS

lockpPointer to the basic lock to be acquired. 

plThe interrupt priority level to be set while the lock is held by the caller.  Because some implementations require that interrupts that might attempt to acquire the lock be blocked on the processor on which the lock is held, portable drivers must specify a pl value that is sufficient to block out any interrupt handler that might attempt to acquire this lock.  See the description of the min_pl argument to LOCK_ALLOC(D3DK) for additional discussion and a list of the valid values for pl.  Implementations which do not require that the interrupt priority level be raised during lock acquisition may choose to ignore this argument. 

DESCRIPTION

LOCK sets the interrupt priority level in accordance with the value specified by pl (if required by the implementation) and acquires the lock specified by lockp.  If the lock is not immediately available, the caller will wait until the lock is available.  It is implementation defined whether the caller will block during the wait.  Some implementations may cause the caller to spin for the duration of the wait, while on others the caller may block at some point. 

RETURN VALUE

Upon acquiring the lock, LOCK returns the previous interrupt priority level (plbase - plhi). 

LEVEL

Base or Interrupt. 

NOTES

Basic locks are not recursive.  A call to LOCK attempting to acquire a lock that is currently held by the calling context will result in deadlock. 

Calls to LOCK should honor the ordering defined by the lock hierarchy [see LOCK_ALLOC(D3DK)] in order to avoid deadlock. 

Driver defined sleep locks may be held across calls to this function. 

Driver defined basic locks and read/write locks may be held across calls to this function subject to the hierarchy and recursion restrictions described above. 

When called from interrupt level, the pl argument must not specify a priority level below the level at which the interrupt handler is running. 

SEE ALSO

LOCK_ALLOC(D3DK), LOCK_DEALLOC(D3DK), TRYLOCK(D3DK), UNLOCK(D3DK)

DDI/DKI

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026