Subject: Re: newlock
To: Hans Petter Selasky <hselasky@c2i.net>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 09/04/2006 09:33:04
On Sep 4, 2006, at 1:34 AM, Hans Petter Selasky wrote:
> If you don't support it I will just make a wrapper for it:
>
> struct mtx {
> kmutex_t mtx_data;
> u_int16_t mtx_recurse;
> u_int16_t mtx_unused;
> };
>
> void
> mtx_lock(struct mtx *p_mtx)
> {
> if (mutex_held(&(p_mtx->mtx_data)) {
> p_mtx->mtx_recurse ++;
> } else {
> mutex_enter(&(p_mtx->mtx_data));
> }
> return;
> }
That's fine ... if you need it, then you make a wrapper around it. I
think that's pretty much what I said to do :-)
> FreeBSD is already using that name. Nice if you can pick another
> name for it.
> That makes porting code easier.
I suppose we could call it mtsleep() (to make it more like ltsleep()).
That said, I don't see why we should adjust our API names because of
decision that another BSD made.
-- thorpej