ATMI C Function Reference
tpgprio()
—Routine for getting a service request priority.
#include <atmi.h>
int tpgprio(void)
tpgprio()
returns the priority for the last request sent or received by the current thread in its current context. Priorities can range from 1 to 100, inclusive, with 100 being the highest priority. tpgprio()
may be called after tpcall()
or tpacall()
, (also tpenqueue()
, or tpdequeue()
, assuming the queued management facility is installed), and the priority returned is for the request sent. Also, tpgprio()
may be called within a service routine to find out at what priority the invoked service was sent. tpgprio()
may be called any number of times and will return the same value until the next request is sent.
In a multithreaded application tpgprio()
operates on a per-thread basis.
Because the conversation primitives are not associated with priorities, issuing tpsend()
or tprecv()
has no affect on the priority returned by tpgprio()
. Also, there is no priority associated with a conversational service routine unless a tpcall()
or tpacall()
is done within that service.
In a multithreaded application, a thread in the TPINVALIDCONTEXT
state is not allowed to issue a call to tpgprio()
.
Upon success, tpgprio()
returns a request's priority;
Upon failure, tpgprio()
returns -1 and sets tperrno
to indicate the error condition.
Upon failure, tpgprio()
sets tperrno
to one of the following values:
tpgprio()
was called and no requests (via tpcall()
or tpacall()
) have been sent, or it is called within a conversational service for which no requests have been sent.
tpacall(3c)
, tpcall(3c)
, tpdequeue(3c)
, tpenqueue(3c)
, tpservice(3c)
, tpsprio(3c)