[asterisk-dev] [Code Review] Call Completion: Asterisk Component

Kevin P. Fleming kpfleming at digium.com
Thu Feb 25 10:49:26 CST 2010


Mark Michelson wrote:

> So to answer your question, it's safe in the sense that a crash or other catastrophic failure will not happen. Of course, when dealing with data that can be changed by another thread, we either need to save off its value prior to unlocking the channel or only access it while the channel is locked. Of course, in this particular case, we're dealing with data that is set once and not changed by other threads anyway.

If that's the case, you might consider declaring the data 'const' and
then explicitly overriding the const-ness in the one place where the
data is written... just as a compile-time safety check.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
skype: kpfleming | jabber: kfleming at digium.com
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list