pthread_cleanup_pop(3T)pthread_cleanup_pop(3T)NAMEpthread_cleanup_pop(), pthread_cleanup_push() - remove or register a
cancellation cleanup handler
SYNOPSISPARAMETERS
routine Routine registered as a cancellation cleanup handler.
arg Parameter to be passed to the cancellation cleanup
handler
execute Indicates if the popped cancellation cleanup handler
is to be executed.
DESCRIPTION
installs the cancellation cleanup handler routine onto the calling
thread's cancellation cleanup stack. This handler will be popped from
the calling thread's cancellation cleanup stack and called with the arg
parameter when any of the following occur:
(a) the thread calls or returns from its start routine.
(b) the thread acts upon a cancellation request.
(c) the thread calls with a non-zero execute argument.
When a thread terminates, it will execute each of the cancellation
cleanup handlers on its cancellation cleanup stack. These handlers will
be popped and executed in the reverse order that they were installed (
removes the cancellation cleanup handler at the top of the calling
thread's cancellation stack. If execute is non-zero, the cancellation
cleanup handler is called after it is removed from the cancellation
stack. If execute is zero, the cancellation cleanup handler is simply
removed and will not be called.
and must appear as statements and in pairs within the same lexical
scope. These functions may be macros which contain the opening '{' in
the push function and the closing '}' in the pop function.
Calling or is undefined if there have been any calls to or made without
the matching call since the jump buffer was filled.
Calling or from inside a cancellation cleanup handler results in unde‐
fined behavior unless the corresponding or was also done inside the
cancellation cleanup handler.
RETURN VALUE
The and functions must be used as statements. They do not have return
values or errors.
ERRORS
None.
WARNINGS
The functions and must be called in the same lexical scope or the
result is undefined behavior.
AUTHOR
and were derived from the IEEE POSIX P1003.1c standard.
SEE ALSOpthread_cancel(3T), pthread_setcancelstate(3T).
STANDARDS CONFORMANCE
Pthread Library pthread_cleanup_pop(3T)