java.util.concurrent.locks.ReentrantLock.getQueueLength()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(245)

本文整理了Java中java.util.concurrent.locks.ReentrantLock.getQueueLength方法的一些代码示例,展示了ReentrantLock.getQueueLength的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ReentrantLock.getQueueLength方法的具体详情如下:
包路径:java.util.concurrent.locks.ReentrantLock
类名称:ReentrantLock
方法名:getQueueLength

ReentrantLock.getQueueLength介绍

[英]Returns an estimate of the number of threads waiting to acquire this lock. The value is only an estimate because the number of threads may change dynamically while this method traverses internal data structures. This method is designed for use in monitoring of the system state, not for synchronization control.
[中]返回等待获取此锁的线程数的估计值。该值只是一个估计值,因为当该方法遍历内部数据结构时,线程的数量可能会动态变化。该方法设计用于监控系统状态,而不是同步控制。

代码示例

代码示例来源:origin: google/guava

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: alibaba/druid

public int getLockQueueLength() {
  return lock.getQueueLength();
}

代码示例来源:origin: prestodb/presto

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: google/j2objc

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: NLPchina/elasticsearch-sql

public int getLockQueueLength() {
  return lock.getQueueLength();
}

代码示例来源:origin: wildfly/wildfly

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: kiegroup/jbpm

protected void createLockOnGetEngine(Long id, RuntimeEngine runtime) {
  if (!isUseLocking()) {
    logger.debug("Locking on runtime manager disabled");
    return;
  }
  
  if (id != null) {
    ReentrantLock newLock = new ReentrantLock();
    ReentrantLock lock = engineLocks.putIfAbsent(id, newLock);
    if (lock == null) {
      lock = newLock;
      logger.debug("New lock created as it did not exist before");
    } else {
      logger.debug("Lock exists with {} waiting threads", lock.getQueueLength());
    }
    logger.debug("Trying to get a lock {} for {} by {}", lock, id, runtime);
    lock.lock();
    logger.debug("Lock {} taken for {} by {} for waiting threads by {}", lock, id, runtime, lock.hasQueuedThreads());
    
  }
  
}

代码示例来源:origin: NLPchina/elasticsearch-sql

connectErrorCount.incrementAndGet();
throw new SQLException("maxWaitThreadCount " + maxWaitThreadCount + ", current wait Thread count "
    + lock.getQueueLength());

代码示例来源:origin: alibaba/druid

connectErrorCountUpdater.incrementAndGet(this);
throw new SQLException("maxWaitThreadCount " + maxWaitThreadCount + ", current wait Thread count "
    + lock.getQueueLength());

代码示例来源:origin: com.alibaba/druid

public int getLockQueueLength() {
  return lock.getQueueLength();
}

代码示例来源:origin: com.alibaba/druid

connectErrorCountUpdater.incrementAndGet(this);
throw new SQLException("maxWaitThreadCount " + maxWaitThreadCount + ", current wait Thread count "
    + lock.getQueueLength());

代码示例来源:origin: org.apache.hbase.thirdparty/hbase-shaded-miscellaneous

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: blazegraph/database

/**
 * The #of threads queued on the internal {@link #lock}. These are (for the
 * most part) threads waiting to start or stop during a group commit.
 * However, you can not use this measure to infer whether there are threads
 * waiting to run which are being starved during a group commit or simply
 * threads waiting to do their post-processing.
 */
public int getInternalLockQueueLength() {
  return lock.getQueueLength();
  
}

代码示例来源:origin: org.sonatype.sisu/sisu-guava

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: com.atlassian.guava/guava

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: org.testifyproject.external/external-guava

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: org.hudsonci.lib.guava/guava

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: io.prestosql/presto-jdbc

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * Returns an estimate of the number of threads waiting to enter this monitor. The value is only
 * an estimate because the number of threads may change dynamically while this method traverses
 * internal data structures. This method is designed for use in monitoring of the system state,
 * not for synchronization control.
 */
public int getQueueLength() {
 return lock.getQueueLength();
}

相关文章