pthread_detach - detach a thread
cc -mt [ flag... ] file... -lpthread [ library... ]
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)
Check Out this Related Man Page
pthread_detach() - mark a thread as detached to reclaim its resources when it terminates
thread Thread whose resources are to be reclaimed immediately when it terminates.
is used to detach the thread thread. When thread terminates, its resources will automatically be reclaimed by the system. If thread has
already terminated, causes the resources of thread to be reclaimed by the system.
does not cause thread to terminate.
Once a detached thread has terminated, its resources, including the thread ID, may be reused by the system. The return status of a detached
thread is lost when the thread terminates.
Calling this function multiple times for the same thread results in undefined behavior.
Upon successful completion, returns zero. Otherwise, an error number is returned to indicate the error (the variable is not set).
If any of the following occur, the function returns the corresponding error number:
[EINVAL] thread does not refer to a joinable thread.
[ESRCH] No thread could be found corresponding to thread.
was derived from the IEEE POSIX P1003.1c standard.
SEE ALSO pthread_create(3T), pthread_join(3T), wait(2).
Pthread Library pthread_detach(3T)
I left an important file on my computer in Montana (I'm in Arizona). It is running Mac OS 10.2.7. For some reason it appears file sharing is off, I don't understand how that happened because I have logged in remotely before. Can someone please tell me if there is any way to use... (7 Replies)
Discussion started by: jellegard
2. Post Here to Contact Site Administrators and Moderators
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)
Hmm, Browsing the forums, bumped into this forum. And unfortunately and pitifully, there was just one thread telling what this forum is for and even more bad, there was another thread which was a technical question.
So you see, it probably only means guys on this forum just can "get away" (as neo... (13 Replies)
wasn't sure if this should have a new thread since I'm still working on the same job I asked a question about earlier. But it's a different problem/question so I guess it deserves a new thread....
I have a log with roughly 10000 lines in it, each one has a timestamp. The problem is, the time... (8 Replies)
Discussion started by: StevePace
6. Post Here to Contact Site Administrators and Moderators
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?
I have 2 files as input for my script.
test.extension... (8 Replies)
Discussion started by: Nemelis
9. Post Here to Contact Site Administrators and Moderators
For our load testing , we are using stubs (unix shell script) which send the response to the request coming from the application. As the unix stub is single threaded , it is responding to only one request whereas multiple requests come in parallely.
I haven't worked on thread concepts... (5 Replies)
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:
... (11 Replies)
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.
exp2: (7 Replies)