|
Re: How to check if a thread is alive
|
09/14/2010 11:27 AM
post67192
|
Re: How to check if a thread is alive
ret = pthread_kill(tid, 0);
will return EOK if the thread exists and ESRCH if it doesn't.
On Tue, Sep 14, 2010 at 11:11:17AM -0400, mike gerlach wrote:
> I have a process that starts a thread. The thread runs continuously and updates a status variable. My main process
does several things and checks the status variable set by the thread. I want to verify the thread is alive before I
check the status variable. I am not finding the mechanism to check if the thread is running. Can someone point me in the
right direction?
>
>
>
> _______________________________________________
>
> OSTech
> http://community.qnx.com/sf/go/post67187
>
--
Brian Stecher (bstecher@qnx.com) QNX Software Systems
phone: +1 (613) 591-0931 (voice) 175 Terence Matthews Cr.
+1 (613) 591-3579 (fax) Kanata, Ontario, Canada K2M 1W8
|
|
|