| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
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.
--Jim _______________________________________________ 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.
| References: | |
| >Re: pthread_* functionality currently in OS X (From: Conrad G T Yoder <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.