Re: Is there such a thing as an invalid thread id?
- From: "Nils O. Selåsdal" <noselasd@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 19 Jan 2006 22:01:42 +0100
Buckaroo_Banzi wrote:
I am creating a threaded application and just wish to return the thread id to the calling function. I am looking to let the calling function determine if pthread_create worked by the thread id.
I have a feeling that there is a thread id value that indicates an invalid thread, such as 0 or -1. Could someone let me know if this is true and if so what value indicates an invalid thread?
Peeking through SUSv2, I can't find any such requirements, but I might not have looked hard enough. Do similar to what pthread_does, return the thread id through a pointer argument, and success/failure as the function return value.
int thr_function(pthread_t *tid);
...
pthread_t tid;
if(thr_function(&tid) {
/*failed */
}
.- Follow-Ups:
- Re: Is there such a thing as an invalid thread id?
- From: Buckaroo_Banzi
- Re: Is there such a thing as an invalid thread id?
- References:
- Is there such a thing as an invalid thread id?
- From: Buckaroo_Banzi
- Is there such a thing as an invalid thread id?
- Prev by Date: Is there such a thing as an invalid thread id?
- Next by Date: Re: Is there such a thing as an invalid thread id?
- Previous by thread: Is there such a thing as an invalid thread id?
- Next by thread: Re: Is there such a thing as an invalid thread id?
- Index(es):