site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Thread-index: Acoy9QqeaBJOH8bDzkS+3F3BR+W5ng== Thread-topic: Thread sleep User-agent: Microsoft-Entourage/12.20.0.090605
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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com