Re: Thread sleep
Re: Thread sleep
- Subject: Re: Thread sleep
- From: Eric Long <email@hidden>
- Date: Fri, 11 Sep 2009 08:32:16 -0700
- Thread-topic: Thread sleep
> 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);
>
Wow, thanks Chris. I totally missed that. Thanks for pointing it out,
showing usage, and not bashing me on the head.
Eric
_______________________________________________
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