Sebb commented on EXEC-106:

I've just double-checked.

All the references (read and write) to the 'stopped' variable are done while 
And the code uses the same lock (this) in each case (explicitly for run and 
implicitly for start/stop)

So AFAICT changes to the ivar will be published correctly and so will be seen 
by the run method.

Do you have a different take on this?

> Watchdog class could use volatile instead of synch
> --------------------------------------------------
>                 Key: EXEC-106
>                 URL: https://issues.apache.org/jira/browse/EXEC-106
>             Project: Commons Exec
>          Issue Type: Improvement
>            Reporter: Sebb
>            Priority: Major
> It looks like the Watchdog class could use volatile for the boolean field 
> 'stopped' instead of synchronising.

This message was sent by Atlassian JIRA

Reply via email to