pthread_setcanceltype() — Set a thread cancelability type format

Standards

Standards / Extensions C or C++ Dependencies

Single UNIX Specification, version 3

both

z/OS V1R7
POSIX(ON)

Format

#define _OPEN_THREADS 2
#include <pthread.h>

int pthread_setcanceltype(int type, int *oldtype);

General description

pthread_setcanceltype() controls when a cancel request is acted on. The old type is stored into the location pointed to by oldtype. The cancelability types can be:

PTHREAD_CANCEL_ASYNCHRONOUS
The thread can be canceled at any time.
PTHREAD_CANCEL_DEFERRED
The thread can be canceled, but only at cancelation points introduced by invocation of particular functions. For more information, see the z/OS XL C/C++ Programming Guide.

Returned value

If successful, pthread_setcanceltype() returns 0. Upon failure, returns the following EINVAL error code:

  • type is an invalid value.

Related information