/** * Check and allocate Pathid if available * * <p> * @param pathid Candidate Path Id * @return True if allocated, otherwise false. */ public static long check_and_allocate_pathid(long pathid) { if (SfcConcurrencyAPI.getPathIdLock()) { try { if (check_suitable_pathid(pathid) && allocate_pathid(pathid)) { return pathid; } else { return -1; } } finally { SfcConcurrencyAPI.releasePathIdLock(); } } else { return -1; } }
if (SfcConcurrencyAPI.getLock()) { try { SfcConcurrencyAPI.releaseLock();
if (SfcConcurrencyAPI.getLock()) { try { SfcConcurrencyAPI.releaseLock();
if (SfcConcurrencyAPI.getPathIdLock()) { try { long symmetric_id = -1; SfcConcurrencyAPI.releasePathIdLock();
final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> change) { printTraceStart(LOG); if (SfcConcurrencyAPI.getLock()) { try { SfcConcurrencyAPI.releaseLock();
/** * Generate pathid, check and allocate if available * * <p> * @return True if allocated, otherwise false. */ public static long check_and_allocate_pathid() { if (SfcConcurrencyAPI.getPathIdLock()) { try { long pathId = -1; GenerationAlgorithmEnum genAlg = getGenerationAlgorithm(); if(genAlg == GenerationAlgorithmEnum.Random) { pathId = generatePathIdRandomIncrements(); } else if(genAlg == GenerationAlgorithmEnum.Sequential) { pathId = generatePathIdSequentialIncrements(); } if ((pathId >= MIN_PATH_ID) && allocate_pathid(pathId)) { return pathId; } else { return -1; } } finally { SfcConcurrencyAPI.releasePathIdLock(); } } else { return -1; } }
if (SfcConcurrencyAPI.getPathIdLock()) { try { ServicePathIdKey servicePathIdKey = new writeMergeTransactionAPI(spIID, servicePathIdBuilder.build(), LogicalDatastoreType.OPERATIONAL); } finally { SfcConcurrencyAPI.releasePathIdLock();