Query: pthread_cleanup_push
OS: netbsd
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
PTHREAD_CLEANUP(3) BSD Library Functions Manual PTHREAD_CLEANUP(3)NAMEpthread_cleanup_push, pthread_cleanup_pop -- add and remove cleanup functions for thread exitLIBRARYPOSIX Threads Library (libpthread, -lpthread)SYNOPSIS#include <pthread.h> void pthread_cleanup_push(void (*cleanup_routine)(void *), void *arg); void pthread_cleanup_pop(int execute);DESCRIPTIONThe pthread_cleanup_push() function adds cleanup_routine to the top of the stack of cleanup handlers that get called when the current thread exits. The pthread_cleanup_pop() function pops the top cleanup routine off of the current threads cleanup routine stack, and, if execute is non- zero, it will execute the function. When cleanup_routine is called, it is passed arg as its only argument. These functions may be implemented as macros which contain scope delimiters; therefore, there must be a matching pthread_cleanup_pop() for every pthread_cleanup_push() at the same level of lexical scoping. The effect of calling longjmp() or siglongjmp() is undefined after a call to pthread_cleanup_push() but before the matching call to pthread_cleanup_pop() after the jump buffer was filled.RETURN VALUESNeither pthread_cleanup_push() nor pthread_cleanup_pop() returns a value.ERRORSNone.SEE ALSOpthread_exit(3)STANDARDSBoth functions conform to IEEE Std 1003.1-2001 (``POSIX.1'').BSDJuly 9, 2010 BSD
Related Man Pages |
---|
pthread_cleanup_pop(3) - redhat |
pthread_cleanup_push(3) - netbsd |
pthread_cleanup_pop(3c) - sunos |
pthread_cleanup_pop(3) - freebsd |
pthread_cleanup_push(3) - freebsd |
Similar Topics in the Unix Linux Community |
---|
pthread_cleanup_push/pop - cleanup handler problem |