On 10/7/2009 7:05 PM Anthony Petrov wrote:
On 10/07/2009 06:57 PM, Artem Ananiev wrote:
Artem, would you agree on placing all calls to the isValid() under the TreeLock?

Yes, that would be fine. Have we already introduced a warning about all

OK, I'll modify the fix for 6887249 accordingly.

Well, I revised the code, and it appears that the 'valid' boolean field is declared volatile. Which basically means that we should only acquire a lock when we need an atomic "read-then-update" sort of operation (like validate() or invalidate() do.) When we need to read the value of this field only w/o subsequent updating it, we don't actually need any locking at all. So I tend to think that the fix for 6887249 should modify the Container.validate() method only. What do you think?

--
best regards,
Anthony

Reply via email to