[concurrency-interest] CopyOnWriteArrayList clone bug?

Joshua Bloch jbloch at gmail.com
Wed Sep 7 12:59:40 EDT 2005


Doug,

Interesting, because this is a general "bug pattern."  If you move
from intrinsic lock to an explicit lock and you have a clone method,
you have to fix it.

        Josh

On 9/7/05, Doug Lea <dl at cs.oswego.edu> wrote:
> Jason Mehrens wrote:
> > In revision: 1.51 of the CopyOnWriteArrayList, the resetLock() method is not
> > invoked on the newly created clone.  Won't this result in one lock being
> > shared over multiple instances?
> >
> 
> Yes. Thanks VERY much! Hopefully we'll get this change in for Mustang.
> It's not quite a bug, but it is not the way anyone wants it to work.
> 
> (Note: The Tiger version of this class does not have this problem.
> For Mustang, we needed to change to use explicit locks but did not
> adjust clone accordingly.)
> 
> -Doug
> 
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
>



More information about the Concurrency-interest mailing list