mirror of
https://github.com/opennetworkinglab/onos.git
synced 2026-05-06 20:56:26 +02:00
Make FlowOperationsProcessor thread-safe with synchronized modifier
Different threads could call run(), satisfy() and fail() method. Each of the methods reads/writes multiple fields during the method call. These method calls need to be synchronized to gurantee to see the latest value. Change-Id: Ic252b56e0902170d7e0fdb83f96f0fb2e55ec56b
This commit is contained in:
parent
7c9b73ab7d
commit
2d7c53932d
@ -609,7 +609,7 @@ public class FlowRuleManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
public synchronized void run() {
|
||||
if (stages.size() > 0) {
|
||||
process(stages.remove(0));
|
||||
} else if (!hasFailed.get() && context != null) {
|
||||
@ -654,7 +654,7 @@ public class FlowRuleManager
|
||||
}
|
||||
}
|
||||
|
||||
void satisfy(DeviceId devId) {
|
||||
synchronized void satisfy(DeviceId devId) {
|
||||
pendingDevices.remove(devId);
|
||||
if (pendingDevices.isEmpty()) {
|
||||
operationsService.execute(this);
|
||||
@ -663,7 +663,7 @@ public class FlowRuleManager
|
||||
|
||||
|
||||
|
||||
void fail(DeviceId devId, Set<? extends FlowRule> failures) {
|
||||
synchronized void fail(DeviceId devId, Set<? extends FlowRule> failures) {
|
||||
hasFailed.set(true);
|
||||
pendingDevices.remove(devId);
|
||||
if (pendingDevices.isEmpty()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user