Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Threads Library Functionspthread_cleanup_pop(3THR)


NAME

 pthread_cleanup_pop - pop a thread cancellation cleanup handler

SYNOPSIS

 
cc -mt [ flag... ] file... -lpthread [ -lrt library... ]

#include <pthread.h>
void pthread_cleanup_pop(int execute);

DESCRIPTION

 

pthread_cleanup_pop() removes the cleanup handler routine at the top of the cancellation cleanup stack of the calling thread and executes it if execute is non-zero.

When the thread calls pthread_cleanup_pop() with a non-zero execute argument, the argument at the top of the stack is popped and executed. An argument of 0 pops the handler without executing it.

The Solaris system generates a compile time error if pthread_cleanup_push() does not have a matching pthread-cleanup_pop().

Be aware that using longjmp() or siglongjmp() to jump into or out of a push/pop pair can lead to trouble, as either the matching push or the matching pop statement might not get executed.

RETURN VALUES

 

The pthread_cleanup_pop() function returns no value.

ERRORS

 

No errors are defined.

The pthread_cleanup_pop() function will not return an error code of EINTR.

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

cancellation(3THR), condition(3THR), pthread_cancel(3THR), pthread_cleanup_push(3THR), pthread_exit(3THR), pthread_join(3THR), pthread_setcancelstate(3THR), pthread_setcanceltype(3THR), pthread_testcancel(3THR), setjmp(3C), attributes(5)

NOTES

 

See cancellation(3THR) for a discussion of cancellation concepts.


SunOS 5.9Go To TopLast Changed 28 Apr 1998

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.