summaryrefslogtreecommitdiff
path: root/manual/pthread_detach.html
diff options
context:
space:
mode:
authorrpj <rpj>2005-05-05 14:18:27 +0000
committerrpj <rpj>2005-05-05 14:18:27 +0000
commit41f88a82b33cdb357c83b582381232733ed2d039 (patch)
treeb3690e999b4d934fce7aab79b2693ab086a4ad46 /manual/pthread_detach.html
parentb75686484d99c90317b64184ce5080093ee7d2a9 (diff)
''
Diffstat (limited to 'manual/pthread_detach.html')
-rw-r--r--manual/pthread_detach.html84
1 files changed, 84 insertions, 0 deletions
diff --git a/manual/pthread_detach.html b/manual/pthread_detach.html
new file mode 100644
index 0000000..e5b668b
--- /dev/null
+++ b/manual/pthread_detach.html
@@ -0,0 +1,84 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+ <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
+ <TITLE>PTHREAD_DETACH(3) manual page</TITLE>
+ <META NAME="GENERATOR" CONTENT="OpenOffice.org 1.1.3 (Linux)">
+ <META NAME="CREATED" CONTENT="20050504;18010700">
+ <META NAME="CHANGED" CONTENT="20050504;18032100">
+ <!-- manual page source format generated by PolyglotMan v3.2, -->
+ <!-- available at http://polyglotman.sourceforge.net/ -->
+</HEAD>
+<BODY LANG="en-GB" BGCOLOR="#ffffff" DIR="LTR">
+<P><A HREF="#toc">Table of Contents</A></P>
+<H2><A HREF="#toc0" NAME="sect0">Name</A></H2>
+<P>pthread_detach - put a running thread in the detached state
+</P>
+<H2><A HREF="#toc1" NAME="sect1">Synopsis</A></H2>
+<P><B>#include &lt;pthread.h&gt;</B>
+</P>
+<P><B>int pthread_detach(pthread_t </B><I>th</I><B>);</B>
+</P>
+<H2><A HREF="#toc2" NAME="sect2">Description</A></H2>
+<P><B>pthread_detach</B> puts the thread <I>th</I> in the detached
+state. This guarantees that the memory resources consumed by <I>th</I>
+will be freed immediately when <I>th</I> terminates. However, this
+prevents other threads from synchronizing on the termination of <I>th</I>
+using <B>pthread_join</B>.
+</P>
+<P>A thread can be created initially in the detached state, using the
+<B>detachstate</B> attribute to <A HREF="pthread_create.html"><B>pthread_create</B>(3)</A>
+. In contrast, <B>pthread_detach</B> applies to threads created in
+the joinable state, and which need to be put in the detached state
+later.
+</P>
+<P>After <B>pthread_detach</B> completes, subsequent attempts to
+perform <B>pthread_join</B> on <I>th</I> will fail. If another thread
+is already joining the thread <I>th</I> at the time <B>pthread_detach</B>
+is called, <B>pthread_detach</B> does nothing and leaves <I>th</I> in
+the joinable state.
+</P>
+<H2><A HREF="#toc3" NAME="sect3">Return Value</A></H2>
+<P>On success, 0 is returned. On error, a non-zero error code is
+returned.
+</P>
+<H2><A HREF="#toc4" NAME="sect4">Errors</A></H2>
+<DL>
+ <DT><B>ESRCH</B>
+ </DT><DD>
+ No thread could be found corresponding to that specified by <I>th</I>
+ </DD><DT>
+ <B>EINVAL</B>
+ </DT><DD STYLE="margin-bottom: 0.5cm">
+ the thread <I>th</I> is already in the detached state
+ </DD></DL>
+<H2>
+<A HREF="#toc5" NAME="sect5">Author</A></H2>
+<P>Xavier Leroy &lt;Xavier.Leroy@inria.fr&gt;
+</P>
+<H2><A HREF="#toc6" NAME="sect6">See Also</A></H2>
+<P><A HREF="pthread_create.html"><B>pthread_create</B>(3)</A> ,
+<A HREF="pthread_join.html"><B>pthread_join</B>(3)</A> ,
+<A HREF="pthread_attr_setdetachstate.html"><B>pthread_attr_setdetachstate</B>(3)</A>
+</P>
+<HR>
+<P><A NAME="toc"></A><B>Table of Contents</B></P>
+<UL>
+ <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect0" NAME="toc0">Name</A>
+ </P>
+ <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect1" NAME="toc1">Synopsis</A>
+ </P>
+ <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect2" NAME="toc2">Description</A>
+ </P>
+ <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect3" NAME="toc3">Return
+ Value</A>
+ </P>
+ <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect4" NAME="toc4">Errors</A>
+ </P>
+ <LI><P STYLE="margin-bottom: 0cm"><A HREF="#sect5" NAME="toc5">Author</A>
+ </P>
+ <LI><P><A HREF="#sect6" NAME="toc6">See Also</A>
+ </P>
+</UL>
+</BODY>
+</HTML> \ No newline at end of file