NPA_SpinTryLock

Tries to acquire a spin lock without spin waiting to allow multiprocessor (MP) safe operations on shared data.

Thread Context:Non-Blocking

Syntax

    LONG NPA_SpinTryLock (
       LONG  *lockStatus
       );
    
    

Parameters

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

Return Values

The following table lists return values and descriptions.

0x0000

Successfully acquired lock.

0x0001

Busy. Unable to acquire lock.

Remarks

NPA_SpinTryLock must be initialized by calling NPA_SpinLockInit before it is called.

It cannot be called recursively.

A TryLock can be used to avoid deadlocks.

If a spin lock is used by both process time and interrupt time code, the process time code should use NPA_SpinTryLockDisable to avoid deadlocks with the interrupt time code.