Re: see if a mutex lock is taken?
Re: see if a mutex lock is taken?
- Subject: Re: see if a mutex lock is taken?
- From: Michael Smith <email@hidden>
- Date: Sun, 10 Feb 2008 19:26:22 -0800
On Feb 10, 2008, at 1:18 PM, Greg wrote:
Is there any way to check and see if a lck_mtx_t has been taken?
(without modifying the lock itself).
Greg,
The answer is meaningless unless you take the lock in the case where
it's not already owned; this is what the 'try' functions do.
If you really are just 'sniffing' the lock, call the 'try' function,
and if it returns success, release the lock. But I'd think long and
hard about what you think you can infer about anything just because
the lock wasn't held when you tried it. (If you're just
introspecting, then ignore the above caution.)
= Mike
_______________________________________________
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