Re: Are mutex functions in documentation current?
Re: Are mutex functions in documentation current?
- Subject: Re: Are mutex functions in documentation current?
- From: Kevin Brock <email@hidden>
- Date: Tue, 25 Oct 2005 18:04:29 -0700
On Oct 25, 2005, at 5:43 PM, Josh Graessley wrote:
kern/locks.h contains the locks you should use in a kernel
extension. These functions look like lck_mtx_lock/lck_mtx_unlock.
Do not use the old style ones or specify com.apple.kernel.6.0.
Now for the other part of the question: does anyone know if there is
*any* documentation on the current functions right now outside of the
source code? Does anyone know if there are plans to put out a
document that mentions the new functions?
Kevin Brock
email@hidden
On Oct 25, 2005, at 5:25 PM, Kevin Brock wrote:
In the kernel dcumentation (Kernel Programming, updated August 11,
2005) they talk about a variety of relatively high level lock and
mutex functions, such as mutex_alloc, mutex_free etc.
Now, the header file (lock.h) doesn't appear to be in the kernel
framework installed by the developer tools, and the enetlognke
sample uses the lower-level Mach locking functions.
If I get the lock.h header from the Darwin code, and add a
dependency on com.apple.kernel.6.0 the mutex_* functions work, but
I get an uneasy feeling doing this. Are there side effects from
depending on this that I need to watch out for?
It certainly *looks* as though the document is wrong, and all of
chapter 16 is being deprecated. Is this correct? Are we supposed
to use only the locking functions in locks.h (lck_grp_alloc_init,
lck_mtx_lock et al)? If we're supposed to be able to use
mutex_alloc and friends, why aren't the headers included?
If we *are* supposed to be using only the lower-level functions,
my question becomes one of documentation. There is virtually no
documentation on the net for those locking functions (lck_*)
except the source code. Now, I have nothing against looking at
the sources... I *like* looking at sources most of the time, but
sadly I have to try to meet a deadline this time, and figuring out
the different premutations of lock groups, lock group attributes
and such from scratch would take a while, and would be *really*
easy to screw up.
Any help would be appreciated.
Thanks.
Kevin Brock
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_______________________________________________
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