[asterisk-dev] Astobj2 and locks

Kevin P. Fleming kpfleming at digium.com
Wed Sep 12 23:36:51 CDT 2007


Watkins, Bradley wrote:
> OK, that makes sense.  I was under the impression the lock was required
> for any kind of change.  But we're most concerned the rug being pulled
> out from underneath us then.

It *would* be required if you changed multiple elements in the structure
and other readers of that structure might misinterpret the contents when
one element has been changed but the others have not. In the case of
changing only one element, or changing elements that are completely
unrelated to each other, it may be safe to change those elements without
holding a lock on the structure.

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - "The Genuine Asterisk Experience" (TM)



More information about the asterisk-dev mailing list