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.
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.