e-docs > Tuxedo > ATMI C Function Reference > Section 3c - C Functions |
ATMI C Function Reference |
Name
tpgprio()—Routine for getting a service request priority.
Synopsis
#include <atmi.h>
int tpgprio(void)
Description
tpgprio() returns the priority for the last request sent or received by the current thread in its curent 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().
Return Values
Upon success, tpgprio() returns a request's priority;
Upon failure, tpgprio() returns -1 and sets tperrno to indicate the error condition.
Errors
Upon failure, tpgprio() sets tperrno to one of the following values:
See Also
tpacall(3c), tpcall(3c), tpdequeue(3c), tpenqueue(3c), tpservice(3c), tpsprio(3c)