}
public ListenableFuture<Boolean> syncup(final InstanceIdentifier<FlowCapableNode> flowcapableNodePath,
- final SyncupEntry syncupEntry) throws InterruptedException {
+ final SyncupEntry syncupEntry) {
+ Semaphore guard = null;
try {
- compressionGuard.acquire();
+ guard = semaphoreKeeper.summonGuardAndAcquire(flowcapableNodePath);
+ if (Objects.isNull(guard)) {
+ return Futures.immediateFuture(Boolean.FALSE);
+ }
final boolean newTaskNecessary = updateCompressionState(flowcapableNodePath, syncupEntry);
if (newTaskNecessary) {
- return super.syncup(flowcapableNodePath, syncupEntry);
- } else {
- return Futures.immediateFuture(Boolean.TRUE);
+ super.syncup(flowcapableNodePath, syncupEntry);
}
+ return Futures.immediateFuture(Boolean.TRUE);
} finally {
- compressionGuard.release();
+ semaphoreKeeper.releaseGuard(guard);
}
}