Open System Services System Calls Reference Manual (G06.25+, H06.03+)
pthread_setcanceltype(2) OSS System Calls Reference Manual
NAME
pthread_setcanceltype
- Sets the calling thread’s cancelability type
LIBRARY
G-series native OSS processes: /G/system/sysnn/zsptsrl
H-series OSS processes: /G/system/zdllnnn/zsptdll
SYNOPSIS
#include <spthread.h>
int pthread_setcanceltype(
int type,
int *oldtype );
PARAMETERS
type specifies the cancelability type to set for the calling thread. Valid values are:
PTHREAD_CANCEL_DEFERRED
oldtype receives the previous cancelability type for the calling thread.
DESCRIPTION
This function sets the calling thread’s cancelability type to the value of the type parameter and
returns its previous cancelability type in the oldtype parameter.
When the cancelability state is PTHREAD_CANCEL_DISABLE (see the
pthread_setcancelstate(2) reference page either online or in the Open System Services System
Calls Reference Manual), a cancelation request cannot be delivered to the thread, even if a can-
celable routine is called or the asynchronous cancelability type is enabled.
When the cancelability state is PTHREAD_CANCEL_ENABLE, cancelability depends on the
thread’s cancelability type. If the thread’s cancelability type is
PTHREAD_CANCEL_DEFERRED, the thread can receive a cancelation request only at
specific cancelation points (including condition waits, thread joins, and calls to the
pthread_testcancel() function.)
When a thread is created, the default cancelability type is PTHREAD_CANCEL_DEFERRED.
The cancelability type of PTHREAD_CANCEL_ASYNCHRONOUS is not supported in this
implementation.
RETURN VALUES
On successful completion, this function returns the calling thread’s previous cancelability type in
the oldtype parameter.
If an error condition occurs, this function returns an integer value indicating the type of error.
Possible return values are:
0 Successful completion.
[EINVAL] The specified type is not PTHREAD_CANCEL_DEFERRED or
PTHREAD_CANCEL_ASYNCHRONOUS.
[ENOTSUP] The specified type is PTHREAD_CANCEL_ASYNCHRONOUS.
RELATED INFORMATION
Functions: pthread_cancel(2), pthread_setcancelstate(2), pthread_testcancel(2).
5−92 Hewlett-Packard Company 527186-003