On Mon, 13 Jun 2022 18:42:24 GMT, Сергей Цыпанов <d...@openjdk.org> wrote:

> If there are two threads calling `Executable.hasRealParameterData()` under 
> race and the first one writes into volatile `Executable.parameters` field 
> (doing _releasing store_) and the second thread reads non-null value from the 
> same field (doing acquiring read) then it must read exactly the same value 
> written into `hasRealParameterData` within `privateGetParameters()`. The 
> reason for this is that we assign `hasRealParameterData` before  _releasing 
> store_.
> 
> In the opposite case (_acquiring read_ reads null) the second thread writes 
> the value itself and returns it from the method so there is no change in 
> behavior.

This pull request has now been integrated.

Changeset: aa557b9b
Author:    Sergey Tsypanov <sergei.tsypa...@yandex.ru>
Committer: Peter Levart <plev...@openjdk.org>
URL:       
https://git.openjdk.org/jdk/commit/aa557b9b01571d7614f54d341c5cd8bf36cdacee
Stats:     48 lines in 1 file changed: 13 ins; 19 del; 16 mod

8288327: Executable.hasRealParameterData should not be volatile

Reviewed-by: plevart

-------------

PR: https://git.openjdk.org/jdk/pull/9143

Reply via email to