[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] pbuf.c issues
From: |
Kieran Mansley |
Subject: |
Re: [lwip-devel] pbuf.c issues |
Date: |
Fri, 31 Mar 2006 10:03:25 +0100 |
On Fri, 2006-03-31 at 10:39 +0200, Christiaan Simons wrote:
> Hi,
>
> * Can anyone explain the idea behind the
> double locking in pbuf_pool_alloc() ??
>
> I see both SYS_ARCH_PROTECT() macro's
> and some pbuf.c local flags like pbuf_pool_alloc_lock
> and pbuf_pool_free_lock.
Given that pbuf_pool_free_lock never seems to be set and
pbuf_pool_alloc_lock is never tested, I can't see that they do anything
useful. Either that or they're really clever and I don't understand it!
I suspect that they're old code that was trying to be more efficient and
have separate locks for alloc and free, but have since been superseded
by the SYS_ARCH_PROTECT macros. Unfortunately, it's been a long time
since I looked at any of this code, so I'm not really sure about the
history of the code - perhaps a quick check through the CVS logs would
reveal their purpose?
Kieran