Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_cleanup_pop(3) [freebsd man page]

PTHREAD_CLEANUP_POP(3)					   BSD Library Functions Manual 				    PTHREAD_CLEANUP_POP(3)

NAME
pthread_cleanup_pop -- call the first cleanup routine LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread.h> void pthread_cleanup_pop(int execute); DESCRIPTION
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. If there is no cleanup routine then pthread_cleanup_pop() does nothing. The pthread_cleanup_pop() function is implemented as a macro that closes a block. Invocations of this function must appear as standalone statements that are paired with an earlier call of pthread_cleanup_push(3) in the same lexical scope. RETURN VALUES
The pthread_cleanup_pop() function does not return any value. ERRORS
None SEE ALSO
pthread_cleanup_push(3), pthread_exit(3) STANDARDS
The pthread_cleanup_pop() function conforms to ISO/IEC 9945-1:1996 (``POSIX.1''). BSD
October 25, 2014 BSD

Check Out this Related Man Page

pthread_cleanup_push(3) 				     Library Functions Manual					   pthread_cleanup_push(3)

NAME
pthread_cleanup_push - (Macro) Establishes a cleanup handler routine to be executed when the thread exits or is canceled. LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so) SYNOPSIS
#include <pthread.h> int pthread_cleanup_push( void (*routine)(void *), void *arg); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: IEEE Std 1003.1c-1995, POSIX System Application Program Interface PARAMETERS
Routine executed as the cleanup handler. Argument passed to the cleanup routine. DESCRIPTION
This routine pushes the specified routine onto the calling thread's cleanup handler stack. The cleanup handler routine is popped from the stack and executed with the arg argument when any of the following actions occur: The thread calls pthread_cleanup_pop(3) and specifies a nonzero value for the execute argument. The thread calls pthread_exit(3). The thread is canceled. An exception is raised and is caught when DECthreads unwinds the calling thread's stack to the lexical scope of the pthread_cleanup_push(3) and pthread_cleanup_pop(3) pair. This routine and pthread_cleanup_pop(3) are implemented as macros and must appear as statements and in pairs within the same lexical scope. You can think of the pthread_cleanup_push(3) macro as expanding to a string whose first character is a left brace ({) and pthread_cleanup_pop(3) as expanding to a string containing the corresponding right brace (}). RETURN VALUES
None RELATED INFORMATION
Functions: pthread_cancel(3), pthread_cleanup_pop(3), pthread_create(3), pthread_exit(3), thread_testcancel(3) Manuals: Guide to DECthreads and Programmer's Guide delim off pthread_cleanup_push(3)
Man Page