void pthread_cleanup_pop(int execute);
#include <pthread.h> /* pop the "func" out of cleanup stack and execute "func" */ pthread_cleanup_pop (1); /* pop the "func" and DONT execute "func" */ pthread_cleanup_pop (0);
A nonzero argument in the pop function removes the handler from the stack and executes the handler. An argument of zero pops the handler without executing the handler.
pthread_cleanup_pop() is effectively called with a nonzero argument when a thread either explicitly or implicitly calls pthread_exit() or when the thread accepts a cancel request.