Re: Thread sleep
Re: Thread sleep
- Subject: Re: Thread sleep
- From: Chris Suter <email@hidden>
- Date: Fri, 11 Sep 2009 09:17:00 +1000
Hi Eric,
Sorry finger trouble; hadn't finished. Here's what I meant to send:
> On Fri, Sep 11, 2009 at 6:44 AM, Eric Long <
email@hidden> wrote:
> Anyone with advice on how to reconcile this?
Look at IOLockSleep and IOLockWakeup. You want code something like this:
IOLockLock(&lock);
while (!condition)
IOLockSleep(&lock, &condition, 0);
IOLockUnlock(&lock)
And in your other thread:
IOLockLock(&lock);
condition = true;
IOLockUnlock(&lock);
IOLockWakeup(&lock, &condition, true);
Kind regards,
Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden