Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_setcancelstate(3t) [hpux man page]

pthread_setcancelstate(3T)												pthread_setcancelstate(3T)

NAME
pthread_setcancelstate(), pthread_setcanceltype() - set and retrieve current thread's cancelability state or type. SYNOPSIS
PARAMETERS
state Value to which the cancelability state of the calling thread is to be set. oldstate Pointer to the location where the old cancelability state of the calling thread will be returned. type Value to which the cancelability type of the calling thread is to be set. oldtype Pointer to the location where the old cancelability type of the calling thread will be returned. DESCRIPTION
atomically sets the calling thread's cancelability state to the value in state and returns the previous cancelability state in oldstate. The legal values for state are: Disable cancelability for the calling thread. Cancellation requests against the calling thread are held pending. Enable cancelability for the calling thread. Cancellation requests against the calling thread may be acted upon. When a pending cancellation request will be acted upon depends on the thread's cancelability type. By default, a thread's cancelability state is set to when it is created. atomically sets the calling thread's cancelability type to the value in type and returns the previous cancelability type in oldtype. The legal values for type are: New or pending cancellation requests against the calling thread may be acted upon at any time (if cancellation is enabled for the calling thread). Cancellation requests for the calling thread are held pending until a cancellation point is reached. A thread's cancelability type is set to when it is created. If a thread's cancelability state is disabled, the setting of the thread's cancelability type has no immediate effect. All cancellation requests are held pending. However, once cancelability is enabled again, the new type will be in effect. RETURN VALUE
Upon successful completion, and return zero. Otherwise, an error number is returned to indicate the error (the variable is not set). ERRORS
For each of the following conditions, if the condition is detected, the and functions return the corresponding error number: [EINVAL] state contains an invalid value. [EINVAL] type contains an invalid value. NOTES
Only functions that are async-cancel safe should be called from a thread that is asynchronously cancelable. AUTHOR
and were derived from the IEEE POSIX P1003.1c standard. SEE ALSO
pthread_exit(3T), pthread_join(3T), pthread_cancel(3T), pthread_cond_wait(3T), pthread_cond_timedwait(3T). STANDARDS CONFORMANCE
Pthread Library pthread_setcancelstate(3T)

Check Out this Related Man Page

pthread_setcanceltype(3)				     Library Functions Manual					  pthread_setcanceltype(3)

NAME
pthread_setcanceltype - Sets the current thread's cancelability type. LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so) SYNOPSIS
#include <pthread.h> int pthread_setcanceltype( int type, int *oldtype); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: IEEE Std 1003.1c-1995, POSIX System Application Program Interface PARAMETERS
The cancelability type to set for the calling thread. The following are valid values: PTHREAD_CANCEL_DEFERRED PTHREAD_CANCEL_ASYNCHRONOUS The previous cancelability type. DESCRIPTION
This routine sets the cancelability type and returns the previous type in oldtype. When the cancelability state is set to PTHREAD_CANCEL_DISABLE, (see pthread_setcancelstate), a cancel cannot be delivered to the thread, even if a cancelable routine is called or asynchronous cancelability type is enabled. When the cancelability state is set to PTHREAD_CANCEL_ENABLE, cancelability depends on the thread's cancelability type. If the thread's cancelability type is set to PTHREAD_CANCEL_DEFERRED, the thread can only receive a cancel at specific cancellation points (including con- dition waits, thread joins, and calls to pthread_testcancel.) If the thread's cancelability type is PTHREAD_CANCEL_ASYNCHRONOUS, the thread can be canceled at any point in its execution. When a thread is created, the default cancelability type is PTHREAD_CANCEL_DEFERRED. Warning If the asynchronous cancelability type is set, do not call any routine unless it is explicitly documented as safe to be called with the asynchronous cancelability type. Note that none of the general run-time libraries and none of the DECthreads libraries are safe except for pthread_setcanceltype, pthread_setcancelstate, and cma_alert_restore. The asynchronous cancelability type should only be used when you have a compute-bound section of code that carries no state and makes no routine calls. RETURN VALUES
On successful completion, this routine returns the previous cancelability type in oldtype. 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 type is not PTHREAD_CANCEL_DEFERRED or PTHREAD_CANCEL_ASYNCHRONOUS. ERRORS
None RELATED INFORMATION
Functions: pthread_cancel(3), pthread_setcancelstate(3), pthread_testcancel(3) Manuals: Guide to DECthreads and Programmer's Guide delim off pthread_setcanceltype(3)
Man Page