finds the scope block that is the active synchronized block

@param sb
the parent scope block to start with
@param monitorEnterPC
the pc where the current synchronized block starts
@return the scope block
496056
private ScopeBlock findSynchronizedScopeBlock(ScopeBlock sb, int monitorEnterPC) {

        ScopeBlock monitorBlock = sb;

        if (sb.hasChildren()) {
            for (ScopeBlock child : sb.getChildren()) {
                if (child.isSync() && (child.getStart() > monitorBlock.getStart())) {
                    monitorBlock = child;
                    monitorBlock = findSynchronizedScopeBlock(monitorBlock, monitorEnterPC);
                }
            }
        }

        return monitorBlock;
    }
839913
@Override
    public boolean registerMonitor(Object monitor) {
        // Process the annotated object, build a configuration, and create probe
        // listeners that represent each call site of the monitor.
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "monitor = " + monitor);
        }
        long startTime = System.nanoTime();
        Set<ProbeListener> listeners = buildListenersFromAnnotated(monitor);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "buildListenersFromAnnotated time = " + TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - startTime) + "usec");
        }

        // Update collections of listeners
        startTime = System.nanoTime();
        if (!addListenersForMonitor(monitor, listeners)) {
            return false;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "addListenersForMonitorTime = " + TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - startTime) + "usec");
        }

        // Process all of the listeners and determine which of the available
        // classes needs to be transformed
        startTime = System.nanoTime();
        Collection<Class<?>> effectedClasses = processNewListeners(listeners);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "processNewListeners time = " + TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - startTime) + "usec");
        }

        // Update the classes with the configured probes
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "effectedClasses.size() = " + effectedClasses.size());
        }
        startTime = System.nanoTime();
        this.transformer.instrumentWithProbes(effectedClasses);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "instrumentWithProbes time = " + TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - startTime) + "usec");
        }

        return true;
    }
164983
protected ScopeImpl getScopeActivity() {
    ScopeImpl scope = null;
    // this if condition is important during process instance startup
    // where the activity of the process instance execution may not be aligned
    // with the execution tree
    if (isProcessInstanceExecution()) {
      scope = getProcessDefinition();
    } else {
      scope = getActivity();
    }
    return scope;
  }
682877
public static lbmonbindings_servicegroup_binding[] get(nitro_service service, String monitorname) throws Exception{
		lbmonbindings_servicegroup_binding obj = new lbmonbindings_servicegroup_binding();
		obj.set_monitorname(monitorname);
		lbmonbindings_servicegroup_binding response[] = (lbmonbindings_servicegroup_binding[]) obj.get_resources(service);
		return response;
	}
1181579
public void run(IProgressMonitor monitor) {
    try {
      page.createType(monitor);
    } catch (CoreException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
210485
def _add_watch_block(self, params, filterCb, capacity=500, cb=None):
		
		if (self._wbslock == None):
			self._wbslock = Lock()

		self._wbslock.acquire()
		wb = WatchBlock(params, filterCb, capacity, cb)  # Add a List of Watchers
		if ((wb != None) and (wb.cb == None)):
			wb.cb = wb._dequeue_default_cb

		self._wbs.append(wb)
		self._wbslock.release()

		if self._cookie == None:
			return None
		if wb != None and len(self._wbs) == 1 and wb.params["pollSec"] == None:
			self._start_enqueue_thread()
		if self._enqueueThread == None:
			return wb

		self._enqueueThreadSignal.acquire()
		self._enqueueThreadSignal.notify()  # Notify
		self._enqueueThreadSignal.release()  # Release the Lock

		return wb
60569
def createMonitor(self, callback=None, errback=None, **kwargs):
        
        import ns1.monitoring
        monitor = ns1.monitoring.Monitor(self.config)
        return monitor.create(callback=callback, errback=errback, **kwargs)
156699
@Unstable
    public long indexOf(Block child)
    {
        CounterBlockMatcher counter = new CounterBlockMatcher(child);

        Block found = getFirstBlock(counter, Axes.ANCESTOR_OR_SELF);

        return found != null ? counter.getCount() : -1;
    }
954447
void processScope(Scope scope) {
    boolean shouldAddToBlockStack = !scope.isHoistScope();
    this.narrowScope = scope;
    if (shouldAddToBlockStack) {
      blockStack.add(new BasicBlock(null, scope.getRootNode()));
    }
    (new NodeTraversal(compiler, this, scopeCreator)).traverseAtScope(scope);
    if (shouldAddToBlockStack) {
      pop(blockStack);
    }
    this.narrowScope = null;
  }
125668
public List<ActivityMonitor> getActivityMonitors(RuntimeContext context) {
        return getActivityMonitors().stream().filter(monitor ->
            monitor.isEnabled(context)
        ).collect(Collectors.toList());
    }
979312
public List<Process> findCalledProcesses(Process mainproc, ProgressMonitor... monitors) throws IOException {
        List<Process> processes = new ArrayList<>();
        for (String pkg : getPackageProcesses().keySet()) {
            for (File procFile : getPackageProcesses().get(pkg)) {
                processes.add(loadProcess(pkg, procFile, true));
            }
        }
        return ProcessHierarchy.findInvoked(mainproc, processes);
    }
309046
public static base_response enable(nitro_service client, String monitorname) throws Exception {
		lbmonitor enableresource = new lbmonitor();
		enableresource.monitorname = monitorname;
		return enableresource.perform_operation(client,"enable");
	}
1133221
public boolean hasChildScope(ScopeType type, String name) {
        log.debug("Has child scope? {} in {}", name, this);
        return children.getBasicScope(type, name) != null;
    }
1297344
private void sawBranch(int seen, int pc) {
        int target = getBranchTarget();
        if (target > pc) {
            if ((seen == Const.GOTO) || (seen == Const.GOTO_W)) {
                int nextPC = getNextPC();
                if (!switchTargets.get(nextPC)) {
                    ScopeBlock sb = findScopeBlockWithTarget(rootScopeBlock, pc, nextPC);
                    if (sb == null) {
                        sb = new ScopeBlock(pc, target);
                        sb.setLoop();
                        sb.setGoto();
                        rootScopeBlock.addChild(sb);
                    } else {
                        sb = new ScopeBlock(nextPC, target);
                        sb.setGoto();
                        rootScopeBlock.addChild(sb);
                    }
                }
            } else {
                ScopeBlock sb = findScopeBlockWithTarget(rootScopeBlock, pc, target);
                if ((sb != null) && !sb.isLoop() && !sb.isCase() && !sb.hasChildren()) {
                    if (sb.isGoto()) {
                        ScopeBlock parent = sb.getParent();
                        sb.pushUpLoadStores();
                        if (parent != null) {
                            parent.removeChild(sb);
                        }
                        sb = new ScopeBlock(pc, target);
                        rootScopeBlock.addChild(sb);
                    } else {
                        sb.pushUpLoadStores();
                        sb.setStart(pc);
                    }
                } else {
                    sb = new ScopeBlock(pc, target);
                    rootScopeBlock.addChild(sb);
                }
            }
        } else {
            ScopeBlock sb = findScopeBlock(rootScopeBlock, pc);
            if (sb != null) {
                ScopeBlock parentSB = sb.getParent();
                while (parentSB != null) {
                    if (parentSB.getStart() >= target) {
                        sb = parentSB;
                        parentSB = parentSB.getParent();
                    } else {
                        break;
                    }
                }

                if (sb.getStart() > target) {
                    ScopeBlock previous = findPreviousSiblingScopeBlock(sb);
                    if ((previous != null) && (previous.getStart() >= target)) {
                        sb = previous;
                    }
                }
                sb.setLoop();
            }
        }
    }
842530
private Counter initAndRegisterCounter(String name) {
        BasicCounter counter = new BasicCounter(MonitorConfig.builder(name).build());
        DefaultMonitorRegistry.getInstance().register(counter);
        return counter;
    }
169458
@Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public Scope scopeSpan(Data data) {
    try (Scope scope = data.tracer.withSpan(data.spanToScope)) {
      return scope;
    }
  }
137060
public static lbmonitor get(nitro_service service, String monitorname) throws Exception{
		lbmonitor obj = new lbmonitor();
		obj.set_monitorname(monitorname);
		lbmonitor response = (lbmonitor) obj.get_resource(service);
		return response;
	}