PTHREAD_DETACH(3) BSD Library Functions Manual PTHREAD_DETACH(3)NAME
pthread_detach -- detach a thread
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h>
int
pthread_detach(pthread_t thread);
DESCRIPTION
The pthread_detach() function is used to indicate to the implementation that storage for the thread thread can be reclaimed when the thread
terminates. If thread has not terminated, pthread_detach() will not cause it to terminate. The effect of multiple pthread_detach() calls on
the same target thread is unspecified.
RETURN VALUES
If successful, the pthread_detach() function will return zero. Otherwise an error number will be returned to indicate the error. Note that
the function does not change the value of errno as it did for some drafts of the standard. These early drafts also passed a pointer to
pthread_t as the argument. Beware!
ERRORS
The pthread_detach() function will fail if:
[EINVAL] The implementation has detected that the value specified by thread does not refer to a joinable thread.
[ESRCH] No thread could be found corresponding to that specified by the given thread ID, thread.
SEE ALSO pthread_join(3)STANDARDS
The pthread_detach() function conforms to ISO/IEC 9945-1:1996 (``POSIX.1'').
BSD April 4, 1996 BSD
Check Out this Related Man Page
pthread_detach(3C)pthread_detach(3C)NAME
pthread_detach - detach a thread
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include <pthread.h>
int pthread_detach(pthread_t thread);
The pthread_detach() function is used to indicate to the implementation that storage for the thread thread can be reclaimed when that
thread terminates. In other words, pthread_detach() dynamically resets the detachstate attribute of the thread to PTHREAD_CRE-
ATE_DETACHED. After a successful call to this function, it would not be necessary to reclaim the thread using pthread_join(). See
pthread_join(3C). If thread has not terminated, pthread_detach() will not cause it to terminate. The effect of multiple pthread_detach()
calls on the same target thread is unspecified.
If successful, pthread_detach() returns 0. Otherwise, an error number is returned to indicate the error.
The pthread_detach() function will fail if:
EINVAL The implementation has detected that the value specified by thread does not refer to a joinable thread.
ESRCH No thread could be found corresponding to that specified by the given thread ID.
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
pthread_create(3C), pthread_join(3C), attributes(5), standards(5)
23 Mar 2005 pthread_detach(3C)
Man Page
13 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
Dear admins,
i remember, my first thread, it is regarding unix systems and i asked some suggestions...
and i like to know how gollum answered for that thread?..
and is gollum is a program?.. (5 Replies)
I'm studing about thread and sometimes when I run this code i receive a SIGSEV
someone have some idea of wath is occuring?
gcc thread.c -o thread -pthread
#include <stdio.h>
#include <pthread.h>
int xip=0;
int main(){
int *thc;
//pthread_create(PID,thread arguments,Process... (2 Replies)
Dear All,
Please to be inform you,I have posted one thread on this forum last 5 days back. I was not getting suggestions for my thread. So i am creating a new thread with detailed of my R&D.
I am new in Shell Scripts, Perl and Cron Jobs. I have one requirement in Cron jobs for FTP Download.... (5 Replies)
I posted this already in another thread, but was told that I should create a seperate thread for the following question:
How do I strip the extension when the delimiter might occur multiple times in the filename?
For example:
I have 2 files as input for my script.
test.extension... (8 Replies)
Hi, I am a newbie and not really familiar with commands, I have searched the forum, but there was only one thread. That thread suggested compressing it and then decompressing it. So I am wondering, what format do I compress it to, and how do I decompress it once I uploaded it from within SFTP... (4 Replies)
Discussion started by: greetea
4 Replies
6. Post Here to Contact Site Administrators and Moderators
So there's this discussion I started (though I guess it's pretty much just myself and one other guy) in the "What's your most useful shell?" thread - Neo suggested that it shouldn't be there and gradually I came to agree with him, so I posted my next message of the discussion to a new thread, which... (3 Replies)
Hi,
I have a simulation program which creates two threads and I would like to know if I can measure the time of each individual thread. Threads communicate (I use pthread to manage them) and I want to measure communication time. I found a solution with clock_gettime and CLOCK_THREAD_CPUTIME_ID... (32 Replies)
Hello,
This is my first post and I would be very thankful if you can help me. I've already searched in the forum and I've found a very similar thread in wich my problem is solved, but the thread is closed and the solution given in it doesn't work in my shell:
153194-problem-quitting-sqlplus
... (11 Replies)
Discussion started by: JuanPerez
11 Replies
9. Post Here to Contact Site Administrators and Moderators
Hello all,
I am a new ubuntu user (have to use it for work) and I am trying to learn and familiarize myself with commands that I will be using frequently.
I would like some help in how I can get a list of all files with certain keywords in the filename.
For example, I have a directory... (8 Replies)
Thanks Ravinder for quick reply.Thats work.
One more thing if i want to extract something based on paranthesis....can you help.
Input:
exp1:
CREATE TABLE
(
A,
B,
C
)
o/p exp1:
A,
B,
C
exp2: (7 Replies)
Discussion started by: raju2016
7 Replies
12. Post Here to Contact Site Administrators and Moderators