[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


pthread_cleanup_pop

Removes the cleanup handler at the top of the cleanup stack and optionally executes it.

Syntax

pthread_cleanup_pop(
                    execute );
 


Argument Data Type Access

execute Boolean read


C Binding

int
pthread_cleanup_pop(
int execute);

Arguments

execute
Integer that specifies whether the cleanup routine in pthread_ cleanup_push is executed when the thread terminates normally (for example, when pthread_exit is called). If the value of execute is 0, the routine is executed only if the thread terminates abnormally (for example, if the thread is canceled). If the value is 1 or more, the routine is executed regardless of whether the thread terminates normally or abnormally.

Description

This routine removes the routine specified in pthread_cleanup_ push at the top of the calling thread's cleanup stack and executes it if the value specified in execute is nonzero.

This routine and pthread_cleanup_push 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 macro as expanding to a string whose first character is a left brace ({) and pthread_ cleanup_pop expanding to a string containing the corresponding right brace (}).

Return Values

If an error is detected, it may be indicated by sending the thread a synchronously generated signal.



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]