At Wed, 27 Mar 2002 11:43:32 -0800, Matt Watson <email@hidden> wrote:
>
> On Wednesday, March 27, 2002, at 11:29 AM, Conrad G T Yoder wrote:
>
> > if (pthread_cond_wait(&condVar, &mutexVar) != 0) {
> > CantHappen();
> > }
>
> What's the condition? You must call pthread_cond_wait() within a loop,
> with a predicate:
>
> pthread_mutex_lock(&m);
> while (condition == 0) {
> pthread_cond_wait(&c, &m);
> }
> /* Do some stuff */
> pthread_mutex_unlock(&m);
All I am looking to do is have this thread sit and wait forever - no one
will be signalling it ever. That's why there's no loop.
> > When I attach with gdb and then interrupt, it is always in
> > semaphore_wait_signal_trap() - from `bt`:
> >
> Why do you say it's spinning? This is normal blocking behavior. Is the
> app taking up CPU? What are the backtraces of the other threads?
The app is taking up ~100% CPU (from `ps`). Sorry, how do I attach to the
other threads in gdb?
-Conrad
_______________________________________________
unix-porting mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/unix-porting
Do not post admin requests to the list. They will be ignored.