[
https://issues.apache.org/jira/browse/POOL-199?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Phil Steitz closed POOL-199.
----------------------------
> GOP/GKOP evict() method is not synchronised and is not thread-safe
> ------------------------------------------------------------------
>
> Key: POOL-199
> URL: https://issues.apache.org/jira/browse/POOL-199
> Project: Commons Pool
> Issue Type: Bug
> Affects Versions: 2.0
> Reporter: Sebb
> Fix For: 2.0
>
>
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)