Re: pthread_join(): any way to limit how long it waits for?
- From: "Maxim Yegorushkin" <maxim.yegorushkin@xxxxxxxxx>
- Date: 30 Jan 2006 05:17:47 -0800
Simon Elliott wrote:
> When a thread exits normally, I want to wait for it to exit, and
> perhaps pick up its status, with pthread_join().
>
> Will there be a race condition if the thread hangs before exiting: will
> pthread_join() wait forever?
No race condition. pthread_join() won't return until the thread
terminates.
> Is there any sensible way to limit the
> time that pthread_join() waits for?
No, just use detached threads and some other means of waiting for a
thread to terminate. Signal a condition, for example, when a thread
terminates, so that you can wait on the condition for a specified
amount of time.
.
- Follow-Ups:
- Re: pthread_join(): any way to limit how long it waits for?
- From: Simon Elliott
- Re: pthread_join(): any way to limit how long it waits for?
- References:
- pthread_join(): any way to limit how long it waits for?
- From: Simon Elliott
- pthread_join(): any way to limit how long it waits for?
- Prev by Date: libXt version
- Next by Date: Re: Find out which character set is used
- Previous by thread: pthread_join(): any way to limit how long it waits for?
- Next by thread: Re: pthread_join(): any way to limit how long it waits for?
- Index(es):
Relevant Pages
|