diff options
author | rpj <rpj> | 2005-05-06 07:27:10 +0000 |
---|---|---|
committer | rpj <rpj> | 2005-05-06 07:27:10 +0000 |
commit | 7523c7c4d75652f67cd31cb123e1268790394c8b (patch) | |
tree | 0920ebf089ccb971e0878542f85486171a541a8a /manual/pthread_detach.html | |
parent | cf42850c77554311e62d3780f6a36cbc38e5e002 (diff) |
''
Diffstat (limited to 'manual/pthread_detach.html')
-rw-r--r-- | manual/pthread_detach.html | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/manual/pthread_detach.html b/manual/pthread_detach.html new file mode 100644 index 0000000..265a467 --- /dev/null +++ b/manual/pthread_detach.html @@ -0,0 +1,86 @@ +<!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"> +<H4>POSIX Threads for Windows – REFERENCE - <A HREF="http://sources.redhat.com/pthreads-win32">Pthreads-w32</A></H4> +<P><A HREF="index.html">Reference Index</A></P> +<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 <pthread.h></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 <Xavier.Leroy@inria.fr> +</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> |