Porting Applications 181
int pthread_setcancelstate(int state, int *oldstate);
int pthread_setcanceltype(int type, int *oldtype);
pthread_setcancelstate is called to ignore or accept the cancellation
request. The request is ignored if the state argument is
PTHREAD_CANCEL_
DISABLE.
Cancellation is enabled if the state is PTHREAD_CANCEL_ENABLE.
If cancellation is enabled, pthread_setcanceltype is called to set either
the immediate or deferred cancellation type. Cancellation is immediately
executed if the type argument is
PTHREAD_CANCEL_ASYNCHRONOUS. If the
type is
PTHREAD_CANCEL_DEFERRED, the cancellation request is deferred
until the next cancellation point.
By default a thread always starts with the cancellation enabled with the
deferred cancellation ...