[asterisk-dev] Re: Pthread wrapper updates

Russell Bryant russell at digium.com
Thu Oct 26 08:10:13 MST 2006


----- Kevin P. Fleming <kpfleming at digium.com> wrote:
> None of the places that you find that don't check the return values
> are doing it because we make a conscious decision not to; they are doing
> it because that's the pattern that was always present in the code and
> everyone follows the existing pattern.

That's not quite true in this case.  At the Asterisk developer's conference
in Italy this Summer, we made a decision that there was no reason we
should be checking the return value of ast_mutex_lock.  The reason that
was given at this time was that since we use recursive mutexes everywhere,
there was no reason we needed to check if it was successful.

Furthermore, on the topic of this thread, I can't imagine *any* case
where if we detect some type of error, that aborting the application
is the right thing to do.  We should always write our code in such a
way that we try to deal with problems and recover from them, and not
intentionally make things worse by aborting the entire application.

-- 
Russell Bryant
Software Engineer
Digium, Inc.



More information about the asterisk-dev mailing list