RFR: 8238170: BeanContextSupport remove and propertyChange can deadlock
Sergey Bylokhov
serb at openjdk.org
Tue Jan 24 23:02:03 UTC 2023
On Tue, 24 Jan 2023 20:12:44 GMT, Andrey Turbanov <aturbanov at openjdk.org> wrote:
> Oof... Approach for synchronization in `BeanContextServicesSupport` is confusing for me and inconsistent. Do you know why read access to `children` is not syncrhonized in `java.beans.beancontext.BeanContextSupport#add` ?
>
> https://github.com/openjdk/jdk/blob/3be5758bb413fb6b4dc6191d78ca38332d5153f1/src/java.desktop/share/classes/java/beans/beancontext/BeanContextSupport.java#L394
Because synchronization in that class is mostly broken.
> // test before locking
I think it is an attempt to make a performance optimization even if it has a race, not sure that it works as expected.
-------------
PR: https://git.openjdk.org/jdk/pull/12158
More information about the client-libs-dev
mailing list