Determines whether this block is guaranteed to begin executing before the given block does.
160027
boolean provablyExecutesBefore(BasicBlock thatBlock) {
    // If thatBlock is a descendant of this block, and there are no hoisted
    // blocks between them, then this block must start before thatBlock.
    BasicBlock currentBlock;
    for (currentBlock = thatBlock;
        currentBlock != null && currentBlock != this;
        currentBlock = currentBlock.getParent()) {}

    if (currentBlock == this) {
      return true;
    }
    return isGlobalScopeBlock() && thatBlock.isGlobalScopeBlock();
  }
393333
def is_safe_to_wait(
        lock_expiration: BlockExpiration,
        reveal_timeout: BlockTimeout,
        block_number: BlockNumber,
) -> SuccessOrError:
    
    # reveal timeout will not ever be larger than the lock_expiration otherwise
    # the expected block_number is negative
    assert block_number > 0
    assert reveal_timeout > 0
    assert lock_expiration > reveal_timeout

    lock_timeout = lock_expiration - block_number

    # A node may wait for a new balance proof while there are reveal_timeout
    # blocks left, at that block and onwards it is not safe to wait.
    if lock_timeout > reveal_timeout:
        return True, None

    msg = (
        f'lock timeout is unsafe.'
        f' timeout must be larger than {reveal_timeout}, but it is {lock_timeout}.'
        f' expiration: {lock_expiration} block_number: {block_number}'
    )
    return False, msg
797676
private boolean beginBlocking() {
    begin();
    synchronized (blockingThreads) {
      if (isOpen()) {
        blockingThreads.add(Thread.currentThread());
        return true;
      }

      return false;
    }
  }
955810
def db_continue( block_id, consensus_hash ):
    

    # every so often, clean up
    if (block_id % 20) == 0:
        log.debug("Pre-emptive garbage collection at %s" % block_id)
        gc.collect(2)

    return is_running() or os.environ.get("BLOCKSTACK_TEST") == "1"
29098
private boolean blockOnPipeLine() {
    if (this.isKilled()) {
      return true;
    }

    // For pipelining of jobs. Will watch other jobs.
    if (!this.pipelineJobs.isEmpty()) {
      String blockedList = "";
      final ArrayList<BlockingStatus> blockingStatus =
          new ArrayList<>();
      for (final String waitingJobId : this.pipelineJobs) {
        final Status status = this.watcher.peekStatus(waitingJobId);
        if (status != null && !Status.isStatusFinished(status)) {
          final BlockingStatus block = this.watcher.getBlockingStatus(waitingJobId);
          blockingStatus.add(block);
          blockedList += waitingJobId + ",";
        }
      }
      if (!blockingStatus.isEmpty()) {
        this.logger.info("Pipeline job " + this.jobId + " waiting on " + blockedList
            + " in execution " + this.watcher.getExecId());

        for (final BlockingStatus bStatus : blockingStatus) {
          this.logger.info("Waiting on pipelined job " + bStatus.getJobId());
          this.currentBlockStatus = bStatus;
          bStatus.blockOnFinishedStatus();
          if (this.isKilled()) {
            this.logger.info("Job was killed while waiting on pipeline. Quiting.");
            return true;
          } else {
            this.logger.info("Pipelined job " + bStatus.getJobId() + " finished.");
          }
        }
      }
    }

    this.currentBlockStatus = null;
    return false;
  }
387058
public boolean isBefore(T element) {
    if (element == null) { return false; }
    return comparator.compare(element, max) > 0;
  }
103631
private void checkTempBlockIdAvailable(long blockId) throws BlockAlreadyExistsException {
    if (mMetaManager.hasTempBlockMeta(blockId)) {
      throw new BlockAlreadyExistsException(ExceptionMessage.TEMP_BLOCK_ID_EXISTS, blockId);
    }
    if (mMetaManager.hasBlockMeta(blockId)) {
      throw new BlockAlreadyExistsException(ExceptionMessage.TEMP_BLOCK_ID_COMMITTED, blockId);
    }
  }
864121
synchronized boolean contains(BlockInfo block) {
    for(LightWeightLinkedSet<BlockInfo> set:priorityQueues) {
      if(set.contains(block)) { return true; }
    }
    return false;
  }
700056
private boolean isReady() {
    if (this.status != Status.READY) {
      // e.g. if the node is disabled, it is not ready to run.
      return false;
    }
    for (final Node parent : this.parents) {
      if (!parent.status.isSuccessEffectively()) {
        return false;
      }
    }
    return true;
  }
1331145
@Nullable
    private TryBlock findBlockWithStart(int pc) {

        for (TryBlock block : blocks) {
            if (block.atStartPC(pc)) {
                return block;
            }
        }

        return null;
    }
582975
function checkSpacingBefore(token, pattern) {
            checkMethodMap[token.value].before(token, pattern || PREV_TOKEN);
        }
545879
protected boolean prePrepare() {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "prePrepare");

        //
        // Cancel timeout prior to completion phase
        //
        cancelAlarms();

        //
        // Inform the Synchronisations we are about to complete
        //
        if (!_rollbackOnly) {
            if (_syncs != null) {
                _syncs.distributeBefore();
            }
        }

        if (tc.isEntryEnabled())
            Tr.exit(tc, "prePrepare", !_rollbackOnly);
        return !_rollbackOnly;
    }
652304
private void verifyFirstBlock() {
    BlockScanInfo block = null;
    synchronized (this) {
      if ( blockInfoSet.size() > 0 ) {
        block = blockInfoSet.first();
      }
    }
    
    if ( block != null ) {
      verifyBlock(block);
      processedBlocks.add(block.block.getBlockId());
    }
  }
282242
@Override public void beforeBlock() {
    if (count > 0) {
      try {
        flush();
      } catch (IOException e) {
        logger.log(Level.SEVERE, "Flush from soy failed", e);
      }
    }
  }
919199
def should_execute(self):
        """"""
        return self.args.apply and (self.args.no_confirm or self.confirm_execution())
369492
def goto_block(self, block):
        
        old_block = self.basic_block
        term = block.terminator
        if term is not None:
            self.position_before(term)
        else:
            self.position_at_end(block)
        try:
            yield
        finally:
            self.position_at_end(old_block)
1291894
private bbBlock init(int initialSize, bbBlock initialBlock)
    {
        this._lastCapacity = BlockedBuffer._defaultBlockSizeMin;
        this._blockSizeUpperLimit = BlockedBuffer._defaultBlockSizeUpperLimit;
        while (this._lastCapacity < initialSize &&
               this._lastCapacity < this._blockSizeUpperLimit)
        {
            this.nextBlockSize(this, 0);
        }
        int count = initialSize / this._lastCapacity;
        if (initialBlock != null) count = 1;
        this._blocks = new ArrayList<bbBlock>(count);
        if (initialBlock == null) {
            initialBlock = new bbBlock(this.nextBlockSize(this, 0));
        }
        this._blocks.add(initialBlock);
        this._next_block_position = 1;
        // create any preallocated blocks (following _next_block_position)
        bbBlock b;
        for (int need = initialSize - initialBlock.blockCapacity()
           ; need > 0
           ; need -= b.blockCapacity()
        ) {
            b = new bbBlock(this.nextBlockSize(this, 0));
            b._idx = -1;
            this._blocks.add(b);
        }
        return initialBlock;
    }