Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_testcancel(3) [osf1 man page]

pthread_testcancel(3)					     Library Functions Manual					     pthread_testcancel(3)

NAME
pthread_testcancel - Requests delivery of a pending cancelation request to the calling thread. LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so) SYNOPSIS
#include <pthread.h> void pthread_testcancel(void); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: IEEE Std 1003.1c-1995, POSIX System Application Program Interface PARAMETERS
None DESCRIPTION
This routine requests delivery of a pending cancelation request to the calling thread. Thus, calling this routine creates a cancelation point within the calling thread. The cancelation request is delivered only if a request is pending for the calling thread and the calling thread's cancelability state is enabled. (A thread disables delivery of cancelation requests to itself by calling pthread_setcancelstate(3).) When called within very long loops, this routine ensures that a pending cancelation request is noticed by the calling thread within a rea- sonable amount of time. RETURN VALUES
None RELATED INFORMATION
Functions: pthread_setcancelstate(3) Manuals: Guide to DECthreads and Programmer's Guide delim off pthread_testcancel(3)

Check Out this Related Man Page

tis_setcancelstate(3)					     Library Functions Manual					     tis_setcancelstate(3)

NAME
tis_setcancelstate - Changes the calling thread's cancelability state. LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <tis.h> int tis_setcancelstate( int state, int *oldstate); STANDARDS
None PARAMETERS
State of general cancelability to set for the calling thread. Valid state values are as follows: PTHREAD_CANCEL_ENABLE PTHREAD_CANCEL_DIS- ABLE Receives the value of the calling thread's previous cancelability state. DESCRIPTION
This routine sets the calling thread's cancelability state to the value specified in the state argument and returns the calling thread's previous cancelability state in the location referenced by the oldstate argument. When a thread's cancelability state is set to PTHREAD_CANCEL_DISABLE, a cancelation request cannot be delivered to the thread, even if a cancelable routine is called or asynchronous cancelability is enabled. When a thread is created, its default cancelability state is PTHREAD_CANCEL_ENABLE. When this routine is called prior to loading threads, the cancelability state propagates to the initial thread in the executing program. Possible Problems When Disabling Cancelability The most important use of a cancelation request is to ensure that indefinite wait operations are terminated. For example, a thread waiting on some network connection, which might take days to respond (or might never respond), should be made cancelable. When a thread's cancelability state is disabled, no routine called within that thread is cancelable. As a result, the user is unable to cancel the operation. When disabling cancelability, be sure that no long waits can occur or that it is necessary for other reasons to defer cancelation requests around that particular region of code. RETURN VALUES
On successful completion, this routine returns the calling thread's previous cancelability state in the oldstate argument. If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows: Successful completion. The specified state is not PTHREAD_CANCEL_ENABLE or PTHREAD_CANCEL_DISABLE. ERRORS
None RELATED INFORMATION
Functions: tis_testcancel(3) Manuals: Guide to DECthreads and Programmer's Guide delim off tis_setcancelstate(3)

Featured Tech Videos