[asterisk-dev] mmichelson: trunk r157427 - /trunk/channels/chan_sip.c

Russell Bryant russell at digium.com
Tue Nov 18 15:20:15 CST 2008

Mark Michelson wrote:
> Russell Bryant wrote:
>> SVN commits to the Digium repositories wrote:

>>> +/*! \brief Protect the callcounters inuse,inringing and the corresponding flags */
>>> +AST_MUTEX_DEFINE_STATIC(callctrlock);
>>> +
>> What is the logic behind using this new global lock for this purpose? 
>> What is wrong with just ensuring that the sip_pvt is locked during these 
>> operations?
> The reason is that we are protecting boht flags that are in the sip_pvt 
> structure and more importantly counters that are in the sip_peer structure (and 
> in the case of 1.6.0, the sip_user structure, too). Because sip_peers and 
> sip_pvts do not necessarily share a 1:1 relationship, the data in the sip_peer 
> is not sufficiently protected by just locking the sip_pvt.

Ok, then it seems like the right thing is to have the sip_pvt and the 
sip_peer locked, then.

Russell Bryant
Senior Software Engineer
Open Source Team Lead
Digium, Inc.

More information about the asterisk-dev mailing list