aboutsummaryrefslogtreecommitdiffstats
path: root/man3/pthread_cleanup_push.3
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2008-11-24 16:45:12 -0500
committerMichael Kerrisk <mtk.manpages@gmail.com>2008-11-25 20:54:25 -0500
commit28e00ccfa55d65cbe1040a061a8099c22f8d5579 (patch)
treee79e4cce6d42b576dcf264b85f64981c5f2a5aa0 /man3/pthread_cleanup_push.3
parent707420475b1fc391ade4f273a4f5313846f52b66 (diff)
downloadman-pages-28e00ccfa55d65cbe1040a061a8099c22f8d5579.tar.gz
pthread_cleanup_push.3: Prematurely exiting a cleanup block is undefined according to POSIX.1
POSIX.1 says that prematurely exiting a push/pop block yields undefined results. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com> Reported-by: Loic Domaigne <tech@domaigne.com>
Diffstat (limited to 'man3/pthread_cleanup_push.3')
-rw-r--r--man3/pthread_cleanup_push.317
1 files changed, 16 insertions, 1 deletions
diff --git a/man3/pthread_cleanup_push.3 b/man3/pthread_cleanup_push.3
index ba65540b19..98b58e708f 100644
--- a/man3/pthread_cleanup_push.3
+++ b/man3/pthread_cleanup_push.3
@@ -21,7 +21,7 @@
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
-.TH PTHREAD_CLEANUP_PUSH 3 2008-11-14 "Linux" "Linux Programmer's Manual"
+.TH PTHREAD_CLEANUP_PUSH 3 2008-11-24 "Linux" "Linux Programmer's Manual"
.SH NAME
pthread_cleanup_push, pthread_cleanup_pop \- push and pop
thread cancellation clean-up handlers
@@ -130,6 +130,21 @@ functions \fIare\fP implemented as macros that expand to text
containing \(aq\fB{\fP\(aq and \(aq\fB}\fP\(aq, respectively.
This means that variables declared within the scope of
paired calls to these functions will only be visible within that scope.
+
+POSIX.1
+.\" The text was actually added in the 2004 TC2
+says that the effect of using
+.IR return ,
+.IR break ,
+.IR continue ,
+or
+.IR goto
+to prematurely leave a block bracketed
+.BR pthread_cleanup_push ()
+and
+.BR pthread_cleanup_pop ()
+is undefined.
+Portable applications should avoid doing this.
.SH EXAMPLE
The program below provides a simple example of the use of the functions
described in this page.