Bug 1729: Make BlockingQueue events in EventDispatcherImpl volatile 63/10863/3
authorFlavio Fernandes <ffernand@redhat.com>
Fri, 5 Sep 2014 20:09:08 +0000 (16:09 -0400)
committerMadhu Venugopal <mavenugo@gmail.com>
Sat, 6 Sep 2014 22:04:06 +0000 (22:04 +0000)
Just like queue in PipelineOrchestratorImpl, events in EventDispatcherImpl
should be volatile since it is expected to be modified by different threads.

Ref gerrit in which Madhu fixes a similar issue in PipelineOrchestratorImpl:
https://git.opendaylight.org/gerrit/#/c/10843/

Change-Id: I923cb974788b0425e28af7823bf6cd23aeeb0f5f
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/EventDispatcherImpl.java

index b14daeae39b659e0e7f421e6192c22ec4f240e7b..6f45bdead6f8bb7b238cf2c007cefaa9adb92c3e 100644 (file)
@@ -29,7 +29,7 @@ public class EventDispatcherImpl implements EventDispatcher {
 
     static final Logger logger = LoggerFactory.getLogger(EventDispatcher.class);
     private ExecutorService eventHandler;
-    private BlockingQueue<AbstractEvent> events;
+    private volatile BlockingQueue<AbstractEvent> events;
 
     private AbstractHandler[] handlers;