HELPLIB.HLB  —  RTL Routines, PPL$  PPL$DECREMENT_SEMAPHORE
    The Decrement a Semaphore routine waits for a semaphore to have a
    value greater than 0, then decrements the value by 1 to indicate
    the allocation of a resource.

    Format

      PPL$DECREMENT_SEMAPHORE  semaphore-id [,flags] [,spin]

1  –  Arguments

 semaphore-id

    OpenVMS usage identifier
    type          longword (unsigned)
    access        read only
    mechanism     by reference
    Identifier of the semaphore. The semaphore-id argument is the
    address of an unsigned longword containing the identifier.

    Semaphore-id is returned by PPL$CREATE_SEMAPHORE.

 flags

    OpenVMS usage mask_longword
    type          longword (unsigned)
    access        read only
    mechanism     by reference
    Bit mask specifying options for decrementing the semaphore. The
    flags argument is a longword bit mask containing the flag. The
    valid values for flags are as follows:

    PPL$M_NON_         Indicates that the caller is not to block if
    BLOCKING           the resource is not available. The default is
                       FALSE: the caller will block if resource is
                       unavailable.
    PPL$M_SPIN_WAIT    Indicates that the caller is never to block,
                       but rather to always spin while waiting at
                       this barrier.
    PPL$M_SPIN_        Indicates that the caller wishes to spin for
    COUNTED            a given amount of instructions and then to
                       block. The default is block immediately, do
                       not spin at all.

 spin

    OpenVMS usage mask_longword
    type          long (unsigned)
    access        read only
    mechanism     by reference
    This value must be specified when using the PPL$M_SPIN_COUNTED
    flag and represents a relative time that a process will spin
    before blocking.
Close Help