PTHREAD_CLEANUP(3) BSD Programmer's Manual PTHREAD_CLEANUP(3)NAME
pthread_cleanup_push, pthread_cleanup_pop - thread specific data value
functions
SYNOPSIS
#include <pthread.h>
void
pthread_cleanup_push(void (*routine)(void *), void *arg);
void
pthread_cleanup_pop(int execute);
DESCRIPTION
This interface is defined by IEEE Std1003.1c (``POSIX'').
The pthread_cleanup_push() function pushes the pthread_exit cleanup han-
dler specified by routine on the calling thread's cleanup handler stack.
This handler is popped from the stack and executed with the single argu-
ment specified in arg when the given thread calls pthread_exit() or exits
its start routine, or when pthread_cleanup_pop() is called with execute
set non-zero.
The pthread_cleanup_pop() function removes the topmost element from the
calling thread's cleanup stack and optionally executes it if execute is
passed non-zero. The popped cleanup routine is called with the argument
registered when pthread_cleanup_push() was called.
SEE ALSOpthreads(3), pthread_exit(3)STANDARDS
The pthread_cleanup_push and pthread_cleanup_pop functions conform to
IEEE Std1003.1c (``POSIX'').
HISTORY
The pthread_cleanup_push and pthread_cleanup_pop functions first appeared
in BSD/OS 3.0.
BUGS
Pthread cleanup handlers are also intended for use with pthread_cancel(),
which this implementation does not currently support.
4th Berkeley Distribution June 3, 1996 1