Re: [sipX-dev] Critical sections
Andy Spitzer wrote:
> Woof!
>
> On Thu, 02 Jul 2009 10:28:31 -0400, Arjun Nair <anair1@xxxxxxxxxx> wrote:
>
>> With the second implementation, even if you do forget to release the
>> semaphore, it's very likely you'd catch the mistake during testing.
>
> What always happens is someone later comes along and throws in a
> "return" (or break, or whatever) somewhere in the middle, on some
> obscure error condition that rarely occurs. In the case of the "auto"
> lock, it gets released, magically. Without that, the lock release may
> get forgotten.
>
> Seen this happen too many times to state "it'll get caught in testing".
> It doesn't.
>
Right, you do make a valid point there..
Arjun