Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0
-
None
Description
The evict() method in Pool2 GOP/GKOP classes is not synchronised, yet it relies on accessing and updating the field evictionIterator without any synchronisation.
Adding volatile to the field would help with safe publication across threads, but won't address the problem of two evictions running in parallel.
AFAICT, two threads running evict() in parallel could operate on the same objects, which will almost certainly cause problems.
The evict() method should probably be synchronised, which would also solve the safe publication problem.