thest1 / LazyList

Lazy load of images in Android
http://stackoverflow.com/questions/541966/android-how-do-i-do-a-lazy-load-of-images-in-listview/3068012#3068012
MIT License
1.2k stars 497 forks source link

Race condition in MemoryCache #34

Open carterpage opened 11 years ago

carterpage commented 11 years ago

Size isn't locked. Simultaneous puts will do weird things.

checkSize() or anything else with an iterator will also have undefined behavior.

Safest quick fix is to synchronize on the public methods, not the "cache" object. Shouldn't be all that different speed-wise, except when a cache resize happens.