How to kill a user thread in Linux.... Help me
Hi all,
I want to kill a thread spawned by main thread from main thread. Before the complition of the spawned thread. I want to know how can i accomplish this task.... ? If any one know plz hepl me... With Regard Rajesh. |
Uh...
What thread library are you using? What programming language? Maybe some example code of what you are trying to do? Groetjes, Kees-Jan |
thread or process?
|
If you are using POSIX threads: keep the pthread_t which is is returned by pthread_create (that is, the thread handle). To kill the thread, use pthread_kill with said pthread_t passed as argument.
HTH |
Thanks all to respond my query. Actully i m using POSIX thread in C and Linux. I got the solution by doing some thing here and there. The answer is :
To terminate a user thread prematurely use the API "pthread_cancel" from the thread which want to kill the target thread. For the furthre details about pthread library follw the following link : ---------------------------------------------------------------------------- http://publib.boulder.ibm.com/iserie...s/users_97.htm ---------------------------------------------------------------------------- hanks all. |
All times are GMT -5. The time now is 01:45 AM. |