pthread_cleanup_push()

establish cancellation handlers 

Function


SYNOPSIS

#include <pthread.h>

void pthread_cleanup_push(void (*handler)(void *), void *arg);


DESCRIPTION

The pthread_cleanup_push() function pushes the specified cancellation cleanup handler onto the cancellation cleanup stack of the calling thread. When a thread exits or is cancelled, and its cancellation cleanup stack is not empty, the cleanup handlers are invoked with the specified argument in last-in-first-out order from the cancellation cleanup stack.

pthread_cleanup_push() and pthread_cleanup_pop() must be paired within the same lexical scope (that is, within a bracketed ({}) statement list). The code does not compile otherwise.

Refer to pthread_cancel() for a more detailed discussion of thread cancellation.


PARAMETERS

handler 

Is the cancellation cleanup handler function to be pushed on the top of the thread's cancellation cleanup stack.

arg 

Is the argument to be passed to the cancellation handler function if it is invoked.


RETURN VALUES

None.


CONFORMANCE

POSIX P1003.1 (1996)


MULTITHREAD SAFETY LEVEL

MT-safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
pthread_cancel(), pthread_cleanup_pop()


PTC MKS Toolkit 10.4 Documentation Build 39.