On Thu, 25 Jan 2024 10:50:32 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:

> Step 6 uses `doFire` variable, it could be set to false using the `cancel` 
> method, which is synchronized. As such, reading the value of `doFire` must 
> also be synchronised.

It's not a problem, the `run` method is synchronized.

There's a bug against it: 
[JDK-8238169](https://bugs.openjdk.org/browse/JDK-8238169): 
_BasicDirectoryModel getDirectories and DoChangeContents.run can deadlock_.

Does `run` need to be synchronised? Probably not, only reading the value of 
`doFire` needs to be.

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

PR Comment: https://git.openjdk.org/jdk/pull/17462#issuecomment-1910079621

Reply via email to