[ 
https://issues.apache.org/jira/browse/EXEC-106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16389670#comment-16389670
 ] 

Gary Gregory commented on EXEC-106:
-----------------------------------

It is possible that the thread running the run() method will NOT see changes to 
the stopped ivar made by the thread that called stopped(). If the volatile 
keyword is added to stopped, then other threads are guaranteed to see the 
change.

> 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
(v7.6.3#76005)

Reply via email to