1pthread_cleanup_pop(3C)  Standard C Library Functions  pthread_cleanup_pop(3C)
2
3
4

NAME

6       pthread_cleanup_pop - pop a thread cancellation cleanup handler
7

SYNOPSIS

9       cc -mt [ flag... ] file... -lpthread [ library... ]
10       #include <pthread.h>
11
12       void pthread_cleanup_pop(int execute);
13
14

DESCRIPTION

16       The  pthread_cleanup_pop() function removes the cleanup handler routine
17       at the top of the cancellation cleanup stack of the calling thread  and
18       executes it if execute is non-zero.
19
20
21       When  the  thread  calls  pthread_cleanup_pop() with a non-zero execute
22       argument, the argument at the top of the stack is popped and  executed.
23       An argument of  0 pops the handler without executing it.
24
25
26       The pthread_cleanup_push(3C) and pthread_cleanup_pop() functions can be
27       implemented as macros. The application must ensure that they appear  as
28       statements,  and  in  pairs within the same lexical scope (that is, the
29       pthread_cleanup_push() macro can be thought to expand to a  token  list
30       whose  first  token  is  '{'  with pthread_cleanup_pop() expanding to a
31       token list whose last token is the corresponding '}').
32
33
34       The effect of the use of return, break, continue, and  goto  to  prema‐
35       turely leave a code block described by a pair of pthread_cleanup_push()
36       and pthread_cleanup_pop() function calls is undefined.
37
38
39       Using longjmp() or siglongjmp() to jump into or out of a push/pop  pair
40       can  result  in  either the matching push or the matching pop statement
41       not getting executed.
42

RETURN VALUES

44       The pthread_cleanup_pop() function returns no value.
45

ERRORS

47       No errors are defined.
48
49
50       The pthread_cleanup_pop() function will not return  an  error  code  of
51       EINTR.
52

ATTRIBUTES

54       See attributes(5) for descriptions of the following attributes:
55
56
57
58
59       ┌─────────────────────────────┬─────────────────────────────┐
60       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
61       ├─────────────────────────────┼─────────────────────────────┤
62       │Interface Stability          │Standard                     │
63       ├─────────────────────────────┼─────────────────────────────┤
64       │MT-Level                     │MT-Safe                      │
65       └─────────────────────────────┴─────────────────────────────┘
66

SEE ALSO

68       pthread_cancel(3C),     pthread_cleanup_push(3C),     pthread_exit(3C),
69       pthread_join(3C),    pthread_setcancelstate(3C),     pthread_setcancel‐
70       type(3C),  pthread_testcancel(3C), setjmp(3C), attributes(5), cancella‐
71       tion(5), condition(5), standards(5)
72

NOTES

74       See cancellation(5) for a discussion of cancellation concepts.
75
76
77
78SunOS 5.11                        4 Oct 2005           pthread_cleanup_pop(3C)
Impressum