NPA_SpinLockDisable

Acquires a specified spin lock and automatically disables interrupts to allow multiprocessor (MP) safe operations on shared data.

Thread Context:Non-Blocking

Syntax

    LONG NPA_SpinLockDisable (
       LONG  *lockStatus
    );
    

Parameters

lockStatus
(IN) Address of the spin lock to be acquired.

Return Values

Processor flags prior to disabling interrupts.

Remarks

NPA_SpinLockDisable disables interrupts on the currently processor only.

Acquires the specified spin lock and automatically disables interrupts. Disables interrupts only after it is determined the lock can be acquired, then spins (does not sleep) until the lock is actually acquired.

Used in the case where a spin lock is used by both process time and interrupt time code when the process time code will use NPA_SpinLockDisable to avoid deadlocks with the interrupt time code.

A spin lock must be initialized using NPA_SpinLockInit before it can be used.

NPA_SpinLockDisable cannot be called recursively.

Thread should not attempt to acquire an already acquired lock or the system deadlocks.

A TryLockDisable can be used to avoid deadlocks.