vpsema(D3X)

vpsema - perform an atomic "V" and "P" semaphore operation on two semaphores

Showing IRIX 6.5.30 (default release). Unchanged since IRIX 6.5.

NAME
     vpsema - perform an atomic "V" and "P" semaphore operation on two
     semaphores

SYNOPSIS
     #include "sys/types.h"
     #include "sys/param.h"
     #include "sys/sema.h"

     vpsema(sema_t *sema1p, sema_t *sema2p, int priority);

DESCRIPTION
     vpsema performs a vsema operation with the first semaphore and a psema on
     the second semaphore and the given priority. (See psema(D3X) and
     vsema(D3X) for details on these operations.) vpsema is atomic in the
     sense that no other process (on a multiprocessor) can perform a semaphore
     operation on the first semaphore before the psema operation has been
     performed on the second semaphore. It effectively "swaps" one semaphore
     for another.

     To initialize semaphores, use initnsema(D3X) or initnsema_mutex(D3X).

   Return Values
     vpsema returns -1 if a signal interrupts a breakable sleep and PCATCH was
     set; otherwise, it returns 0.

   See Also
     initnsema(D3X), initnsema_mutex(D3X), psema(D3X), vsema(D3X),
     SLEEP_UNLOCK(D3)