OSDN Git Service

LDP: Update original to LDP v3.79
[linuxjm/LDP_man-pages.git] / original / man3 / pthread_setcancelstate.3
index 4828279..4eca0fc 100644 (file)
@@ -1,6 +1,7 @@
 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
 .\"     <mtk.manpages@gmail.com>
 .\"
+.\" %%%LICENSE_START(VERBATIM)
 .\" Permission is granted to make and distribute verbatim copies of this
 .\" manual provided the copyright notice and this permission notice are
 .\" preserved on all copies.
@@ -20,8 +21,9 @@
 .\"
 .\" Formatted or processed versions of this manual, if unaccompanied by
 .\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
 .\"
-.TH PTHREAD_SETCANCELSTATE 3 2008-11-24 "Linux" "Linux Programmer's Manual"
+.TH PTHREAD_SETCANCELSTATE 3 2014-05-13 "Linux" "Linux Programmer's Manual"
 .SH NAME
 pthread_setcancelstate, pthread_setcanceltype \-
 set cancelability state and type
@@ -33,6 +35,7 @@ set cancelability state and type
 .BI "int pthread_setcanceltype(int " type ", int *" oldtype );
 .sp
 Compile and link with \fI\-pthread\fP.
+.fi
 .SH DESCRIPTION
 The
 .BR pthread_setcancelstate ()
@@ -107,6 +110,13 @@ Invalid value for
 .IR type .
 .\" .SH VERSIONS
 .\" Available since glibc 2.0
+.SH ATTRIBUTES
+.SS Multithreading (see pthreads(7))
+The
+.BR pthread_setcancelstate ()
+and
+.BR pthread_setcanceltype ()
+functions are thread-safe.
 .SH CONFORMING TO
 POSIX.1-2001.
 .SH NOTES
@@ -119,7 +129,7 @@ that must not be interrupted by a cancellation request.
 Beware of disabling cancelability for long periods,
 or around operations that may block for long periods,
 since that will render the thread unresponsive to cancellation requests.
-
+.SS Asynchronous cancelability
 Setting the cancelability type to
 .B PTHREAD_CANCEL_ASYNCHRONOUS
 is rarely useful.
@@ -138,9 +148,10 @@ Furthermore, some internal data structures
 family of functions) may be left in an inconsistent state
 if cancellation occurs in the middle of the function call.
 Consequently, clean-up handlers cease to be useful.
+
 Functions that can be safely asynchronously canceled are called
 .IR "async-cancel-safe functions" .
-POSIX.1-2001 only requires that
+POSIX.1-2001 requires only that
 .BR pthread_cancel (3),
 .BR pthread_setcancelstate (),
 and
@@ -148,9 +159,10 @@ and
 be async-cancel-safe.
 In general, other library functions
 can't be safely called from an asynchronously cancelable thread.
+
 One of the few circumstances in which asynchronous cancelability is useful
 is for cancellation of a thread that is in a pure compute-bound loop.
-
+.SS Portability notes
 The Linux threading implementations permit the
 .I oldstate
 argument of
@@ -176,3 +188,12 @@ See
 .BR pthread_cleanup_push (3),
 .BR pthread_testcancel (3),
 .BR pthreads (7)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.