TimedWaitOnLocalSemaphore

Waits on a local semaphore until it is signalled or the specified timeout elapses

Local Servers:blocking
Remote Servers:N/A
Classification:3.x, 4.x, 5.x, 6.x
Service:Thread

Syntax

  #include <nwsemaph.h>  
   
  int TimedWaitOnLocalSemaphore  (  
     LONG   semaphoreHandle,   
     LONG   timeout);
  

Parameters

semaphoreHandle
(IN) Specifies the handle of the semaphore to wait on.
timeout
(IN) Specifies the maximum time, in milliseconds, to wait on the semaphore.

Return Values

The following table lists return values and descriptions.

Value

Hex

Name

0

(0x00)

ESUCCESS

254

(0xFE)

ERR_TIMEOUT_FAILURE

WARNING:A bad semaphore handle causes the server to abend.

Remarks

TimedWaitOnLocalSemaphore is similar to WaitOnLocalSemaphore except that a waiting time is specified. If the semaphore is not signalled prior to the expiration of the timeout parameter period, TimedWaitOnLocalSemaphore returns an error.

See Also

CloseLocalSemaphore, ExamineLocalSemaphore, OpenLocalSemaphore, SignalLocalSemaphore, WaitOnLocalSemaphore