Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Book 4-Appendices - <b>nnetsemwai()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 NNETSEMWAI()
 Decrements a semaphore
------------------------------------------------------------------------------
 Syntax

     NNETSEMWAI(<nHandle>,[<nTimeout>],
        [<cServer>|<nConId>]) --> lSuccess

     Netware: 2.2 and 3.11

 Arguments

     <nHandle>  Designates the semaphore handle that is returned by
     NNETSEMOPN() when the semaphore is opened.

     <nTimeout>  Designates a time period in 1/18 seconds that
     NNETSEMWAI() must wait if the semaphore <nHandle> cannot be locked
     successfully.  The default value is 0.5 seconds (9).

     <cServer>  Designates the name of the file server on which <nHandle>
     has been created.  Your workstation must be attached to <cServer>.

     <nConId>  Designates the connection ID for your workstation on
     <cServer>.

 Returns

     NNETSEMWAI() returns .T. if the semaphore has been locked successfully
     (the semaphore's value is greater than 0).  If the semaphore has not
     been locked successfully (the semaphore.s value is equal to 0), the
     function returns .F..

 Description

     NOVELL NET SEMAPHOR WAIT
     NNETSEMWAI() tries to lock a semaphore.  The semaphore is specified by a
     handle.  NNETSEMWAI() decrements the value of the semaphore <nHandle> by
     1.  A semaphore is locked if the value is greater than or equal to 0
     after it decrements..  In this case, NNETSEMWAI() returns .T..  If the
     value is negative, NNETSEMWAI() waits for a specific time period.  If
     the value does not become positive within the specified time period,
     NNETSEMWAI() resets the value to its start value and returns .F.. The
     time period is calculated by multiplying  <nTimeout>  with 1/18 seconds.

 Example

     Open the semaphore, and then try to lock the semaphore:

     nHandle=NNETSEMOPN('TEST')
     IF NNETSEMWAI(nHandle)
        ? 'Semaphore locked successfully!'
     ELSE
        ? 'Semaphor could not be locked!'
     ENDIF

See Also: NNETSEMSGN()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson