site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Thanks, Ryan rmcgann@mac.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... The new Tiger locking KPIs seem to lack a trylock variant for any of the lock types (mutex, spinlock, read/write). I'm trying to figure out how to get around this. I need to take a read-write lock in a socket filter dataIn callback, but of course you cannot block inside dataIn for any length of time. So I _was_ going to use a trylock, and if I failed to get the lock, just bail out. But it looks like the only way to accomplish what I want to do is to use lck_rw_sleep_deadline. However I'm not exactly sure of the semantics of this API. If I give it a deadline of "now", will it still perform a context switch regardless of whether the lock is taken or not? I don't want the expense of a context switch if the lock isn't even going to be taken. Is there any way of duplicating the behavior of a trylock using the Tiger KPIs? Or am I stuck using lck_rw_sleep_deadline? And can that API context switch on me without taking the lock? This email sent to site_archiver@lists.apple.com