NCS_TryLock (Obsolete 10/5/2005)

Attempted to acquire a distributed lock but is now obsolete.

Syntax

 #include <ncssdk.h> 
  
 NCS_RETURN NCS_TryLock 
 
 (
   NCS_HANDLE   Handle, 
   NCS_KEY      Key, 
   UINT32       KeyLen
   UINT32      *Holder);
 

Parameters

Handle

(IN) Specifies the application’s handle.

Key

(IN) Specifies the lock key (maximum 32 bytes).

KeyLen

(IN) Specifies the lock key length.

Holder

(OUT) Points to the bitmask of the node that currently holds the lock.

Return Values

Name

Description

SUCCESS

NCS_SUCCESS.

NCS_BAD_PARAMETER

See NDS Error Codes.

NCS_FAILURE

Unspecified failure.

NCS_NO_RESOURCES

No resources to perform requested operation.

NCS_NOT_SUPPORTED

Message returned when NCS_ClusterIPAddress is called in a cluster running on a platform version less than NetWare 6.

NCS_TRYLOCK_HELD

Indicates that another application on another node has a lock.

Remarks

The difference between NCS_TryLock and NCS_Lock (Obsolete 10/5/2005) is that NCS_Lock will block until it can get the log. NCS_TryLock, on the other hand, provides a polling mechanism by returning an error code indicating it can’t lock an application.