BUG-1455: improve thread safety/performance 08/9508/5
authorVaclav Demcak <vdemcak@cisco.com>
Mon, 11 Aug 2014 14:49:03 +0000 (16:49 +0200)
committermichal rehak <mirehak@cisco.com>
Tue, 12 Aug 2014 17:12:30 +0000 (17:12 +0000)
commit4ac150971ea0ef2988c9fd21a2f5f40022a22fd7
tree31064900c4e09b76375fa3d486c28f5a7f2d32d3
parentfcbc7be61d800a5bf398a949d295a5f589871eda
BUG-1455: improve thread safety/performance

There were couple of things wrong with this code: flipping 'starving'
field needlessly, which could end up in needless calls to notify().
Split that field into local state and volatile status indicator.

finished is not volatile, so the checks can actually get removed at
runtime, breaking the shutdown() functionality. Also an explicit ping()
is needed to wake a starving harvester.

Change-Id: I58b46a3f2e593e3873c47c30d2fe0d22d4304e8f
Signed-off-by: Robert Varga <rovarga@cisco.com>
Signed-off-by: Vaclav Demcak <vdemcak@cisco.com>
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/queue/QueueKeeperHarvester.java