commit | d21c4ddaeeffc63ffe04986c520eac4b2b42bce6 | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Thu Aug 18 11:26:16 2016 -0700 |
committer | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Tue Aug 30 13:30:36 2016 -0700 |
tree | b338cd79a0ef8ffe04b750f6b032c58946e9bb52 | |
parent | 723907835a27adc8b6e74fa6fc2c60b56c1b6b21 [diff] |
Read the latest value of dispatchFuture The field, dispatchFuture, is accessed in activate() method and the thread where Watchdog is running. Then, different threads could access the field and couldn't read the latest value. Change-Id: Iceb390bcf3c5711c1dbb59198667138c8a90b036
diff --git a/core/net/src/main/java/org/onosproject/event/impl/CoreEventDispatcher.java b/core/net/src/main/java/org/onosproject/event/impl/CoreEventDispatcher.java index 1647eff..26a89d4 100644 --- a/core/net/src/main/java/org/onosproject/event/impl/CoreEventDispatcher.java +++ b/core/net/src/main/java/org/onosproject/event/impl/CoreEventDispatcher.java
@@ -75,7 +75,7 @@ private TimerTask watchdog; private EventSink lastSink; private final Stopwatch stopwatch = Stopwatch.createUnstarted(); - private Future<?> dispatchFuture; + private volatile Future<?> dispatchFuture; @Override public void post(Event event) {