commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (EXEC-106) Watchdog class could use volatile instead of synch
Date Wed, 07 Mar 2018 15:11:00 GMT

    [ 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)

Mime
View raw message