< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [sipX-dev] Critical sections


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.

--Woof!