HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
p
pthread_setcancelstate(3T) pthread_setcancelstate(3T)
(Pthread Library)
NAME
pthread_setcancelstate(), pthread_setcanceltype() - set and retrieve the 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
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
pthread_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:
PTHREAD_CANCEL_DISABLE
Disable cancelability for the calling thread. Cancellation requests against the calling thread are
held pending.
PTHREAD_CANCEL_ENABLE
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
cancelabilitytype.
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:
PTHREAD_CANCEL_ASYNCHRONOUS
New or pending cancellation requests against the calling thread may be acted upon at any time
(if cancellation is enabled for the calling thread).
PTHREAD_CANCEL_DEFERRED
Cancellation requests for the calling thread are held pending until a cancellation point is
reached.
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 VALUE
Upon 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).
ERRORS
For each of the following conditions, if the condition is detected, the pthread_setcancelstate()
and pthread_setcanceltype()
functions return the corresponding error number:
HP-UX Release 11i: December 2000 1 Section 3723
___
___