pthread_cleanup_pop Subroutine Purpose Removes, and optionally executes, the routine at the top of the calling thread's cleanup stack. Library Threads Library (libpthreads.a) Syntax #include void pthread_cleanup_pop (execute) int execute; Description The pthread_cleanup_pop subroutine removes the routine at the top of the calling thread's cleanup stack. If the execute parameter is non-zero, the routine is executed. The cleanup stack is a LIFO (last in first out) stack, used for performing all cleanups necessary for safe thread termination. The pthread_cleanup_pop subroutine must be in the same function and in the same block of statements than the corresponding call to the pthread_cleanup_push subroutine. Otherwise, the compiler may fail compiling the program, or the program would have an unpredictable behaviour when porting to other systems. The reason is that, on non-AIX systems, the pthread_cleanup_pop subroutine may be implemented as a macro closing a block of statements. Note: The pthread.h header file must be the first included file of each source file using the threads library. Parameters execute Specifies if the popped routine will be executed. Implementation Specifics This subroutine is part of the Base Operating System (BOS) Runtime. Related Information The pthread_cleanup_push subroutine, pthread_exit subroutine. Terminating Threads. Threads Library Quick Reference.