[Previous] [Contents] [Next]

pthread_setcancelstate()

Set a thread's cancellation state

Synopsis:

#include <pthread.h>

int pthread_setcancelstate( int state,
                            int* oldstate );

Library:

libc

Description:

The pthread_setcancelstate() function sets the calling thread's cancellation state to state and returns the previous cancellation state in oldstate.

The cancellation state can have the following values:

Cancellation state Meaning
PTHREAD_CANCEL_DISABLE Cancellation requests are held pending.
PTHREAD_CANCEL_ENABLE Cancellation requests may be acted on according to the cancellation type, see pthread_setcanceltype().

The default cancellation state for a thread is PTHREAD_CANCEL_ENABLE.

Returns:

EOK
Success.
EINVAL
Invalid cancelability state state.

Classification:

POSIX 1003.1 (Threads)

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

pthread_cancel(), pthread_setcanceltype(), pthread_testcancel()


[Previous] [Contents] [Next]