NWWaitOnSemaphore

Waits on a semaphore for a specified time

NetWare Server:3.11, 3.12, 3.2, 4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Synchronization

Syntax

  #include <nwsync.h> 
  or 
  #include <nwcalls.h> 
   
  N_EXTERN_LIBRARY( NWCCODE )NWWaitOnSemaphore  ( 
     NWCONN_HANDLE   conn,  
     nuint32         semHandle,  
     nuint16         timeOutValue);
  

Delphi Syntax

  uses calwin32 
   
  Function NWWaitOnSemaphore 
    Function NWWaitOnSemaphore 
  (conn : NWCONN_HANDLE; 
     semHandle : nuint32; 
     timeOutValue : nuint16 
  ) : NWCCODE;
  

Parameters

conn
(IN) Specifies the NetWare server connection handle.
semHandle
(IN) Specifies the semaphore handle returned by calling NWOpenSemaphore.
timeOutValue
(IN) Specifies the length of time the application will wait for the semaphore.

Return Values

These are common return values; see Return Values (NDK: Connection, Message, and NCP Extensions) for more information.

0x0000

SUCCESSFUL

0x8801

INVALID_CONNECTION

0x890A

NLM_INVALID_CONNECTION

0x89FE

TIMEOUT_FAILURE

0x89FF

LOCK_ERROR

Remarks

NWWaitOnSemaphore decrements the semaphore value counter by 1 if it is greater than 0. If the semaphore value counter and the timeOutValue parameter are both 0, a time out failure (LOCK_ERROR) will be returned. If the value is 0 before the time out expires, Successful is returned, and the application can access the associated resource.

If the value is <0, NWWaitOnSemaphore queues the application for the time interval specified in timeOutValue.

timeOutValue indicates how long the NetWare server should wait if the semaphore value is negative. timeOutValue is specified in units of 1/18 second (0 = no wait). It has no default value.

See Also

NWCloseSemaphore, NWExamineSemaphore, NWOpenSemaphore, NWSignalSemaphore