Pushes a cleanup routine onto the cleanup stack of the calling thread.
#include <pthread.h> void pthread_cleanup_push ( void (*routine)(void *), void *arg);
(IN) Points to the routine to push onto the cleanup stack.
(IN) Points to the argument to pass to the cleanup routine.
The cleanup routine is executed when the calling thread does one of the following:
Exits by calling pthread_exit.
Responds to a cancellation request.
Calls pthread_cleanup_pop with a nonzero value for the execute parameter.