*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> pthread_cleanup_push (3p)              


pthread_cleanup_push(3P)			      pthread_cleanup_push(3P)

NAME    [Toc]    [Back]

     pthread_cleanup_push, pthread_cleanup_pop - manage	thread cleanup

C SYNOPSIS    [Toc]    [Back]

     #include <pthread.h>

     void pthread_cleanup_push(void (*cleanup)(void *),	void *arg);
     void pthread_cleanup_pop(int exec);

DESCRIPTION    [Toc]    [Back]

     A thread may register cleanup handlers which are automatically called on
     behalf of the thread when it terminates either through cancellation [see
     pthread_cancel()],	explicitly exiting [see	pthread_exit()]	or by
     returning from its	start function [see pthread_create()].	Handlers are
     run in order: most	recently registered first.

     Handlers have strict scoping rules: the push and pop must be in the same
     C lexical scope; that is, the pop operation must match the	push operation
     in	the same C statement block.  Threads should never jump out of or into
     a cleanup pair, for example using goto or longjmp().

     The pthread_cleanup_push()	function registers the function	cleanup	as a
     cleanup handler for the calling thread.  When invoked, cleanup will be
     passed the	parameter arg.

     The pthread_cleanup_pop() function	unregisters the	last handler.  If the
     parameter exec is non-zero	then the handler will be executed.

DIAGNOSTICS    [Toc]    [Back]

     Not applicable.

SEE ALSO    [Toc]    [Back]

     pthread_cancel(3P), pthread_exit(3P), pthread_create(3P), longjmp(3C).

									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
pthread_cleanup_push FreeBSD add a cleanup function for thread exit
pthread_cleanup_push OpenBSD add a cleanup function for thread exit
pthread_cleanup_push Tru64 (Macro) Establishes a cleanup handler routine to be executed when the thread exits or is canceled
pthread_cleanup_pop Tru64 (Macro) Removes the cleanup handler routine from the calling thread's cleanup handler stack and opti...
pthread_setcancelstate IRIX manage cancelability of a thread
pthread_attr_setschedparam IRIX manage thread scheduling priority attributes
pthread_cleanup_pop OpenBSD call the first cleanup routine
openpam_free_data FreeBSD generic cleanup function
pthread_cleanup_pop FreeBSD call the first cleanup routine
cleanup HP-UX HP-UX patch cleanup utility
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service