[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
FN_SEMWAIT()
Wait on a semaphore (decrement)
------------------------------------------------------------------------------
Syntax
fn_semWait( <nHandle> [, nTimeout ] ) -> nRc
Arguments
<nHandle> is the semaphore handle, returned from a previous call
to fn_semOpen().
<nTimeOut> is an optional parameter telling how long you wish to
wait on this semaphore. This is a numeric indicating the number
of clock ticks (approx 1/18 sec ) to wait. A zero (the default)
means "don't wait."
Returns
nRc, a numeric, as follows:
0 - success
254 - timeout failure
255 - invalid semaphore handle
Description
See the description for the fn_semOpen() function.
Examples
fn_semOpen( "Semaphore Test", nInitVal, @nHandle, @nOpenCnt )
nRc := fn_semWait( nHandle )
IF nRc == 254
QOUT( "All slots for this resource are currently in use" )
QUIT
ENDIF
Source: N:\SRC\SYNCHRO\SEMA.PRG
Author: Glenn Scott
See Also:
FN_SEMOPEN()
FN_SEMEX()
FN_SEMSIG()
FN_SEMCLOS()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson