United States-English |
|
|
HP-UX Reference > Ppthread_setcancelstate(3T)Pthread LibraryHP-UX 11i Version 3: February 2007 |
|
NAMEpthread_setcancelstate(), pthread_setcanceltype() — set and retrieve current thread's cancelability state or type. SYNOPSIS#include <pthread.h> int pthread_setcancelstate( int state, int *oldstate ); int pthread_setcanceltype( int type, int *oldtype ); PARAMETERS
DESCRIPTIONpthread_setcancelstate() 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:
By default, a thread's cancelability state is set to PTHREAD_CANCEL_ENABLE when it is created. pthread_setcanceltype() 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:
A thread's cancelability type is set to PTHREAD_CANCEL_DEFERRED 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 VALUEUpon successful completion, pthread_setcancelstate() and pthread_setcanceltype() return zero. Otherwise, an error number is returned to indicate the error (the errno variable is not set). ERRORSFor each of the following conditions, if the condition is detected, the pthread_setcancelstate() and pthread_setcanceltype() functions return the corresponding error number:
NOTESOnly functions that are async-cancel safe should be called from a thread that is asynchronously cancelable. AUTHORpthread_setcancelstate() and pthread_setcanceltype() were derived from the IEEE POSIX P1003.1c standard. SEE ALSOpthread_exit(3T), pthread_join(3T), pthread_cancel(3T), pthread_cond_wait(3T), pthread_cond_timedwait(3T). |
Printable version | ||
|