Hi Pavel,
You are correct, state is volatile.
It seemed unnecessary/redundant since except for isRunning it is updated
inside a synchronize(lock).
The synchronized(socketList) is also unnecessary since it is already
synchronized on lock.
Roger
On 8/7/19 1:18 PM, Pavel Rappo wrote:
Roger, thank you for looking at this. While we might hear (on some of your
questions) from Chris soon, I just have to ask about this one
On 7 Aug 2019, at 16:52, Roger Riggs <roger.ri...@oracle.com> wrote:
238: isRunning should be synchronized(lock) to make sure each Thread sees the
same value threads that update it in start() and close()
What makes you think they can see something different? Even though the result of
this call is immediately outdated, the changes to the state made by start/close
should be propagated as per JMM.