Function NnetSemWai() Foundation

Waits for a semaphore to become available (decrements semaphore value)

Syntax
NnetSemWai( <nSemaphoreHandle>        , ;
            [<nTimeout>]              , ;  // Default: 9
            [<cFileServer|nConnectID>]  ;  // Default: NnetSname()
          ) --> lSemaphoreIsAvailable
Return

Returns .T. when the semaphore <nSemaphoreHandle> is available for the workstation.

Description

The function decrements the semaphore value. As long as the value is positive the semaphore is available and .T. is returned. If the value goes negative the function waits <nTimeOut> * 1/18th seconds for another workstation to signal the semaphore (increment its value). If the semaphore value is still negative after the timeout interval the function returns .F. and the semaphore is not available.

When NnetSemWai() returns .T. function NnetSemSgn() must be called in order to increment the semaphore value again.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.