java.util.concurrent.ThreadPoolExecutor.decrementWorkerCount()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(97)

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

ThreadPoolExecutor.decrementWorkerCount介绍

[英]Decrements the workerCount field of ctl. This is called only on abrupt termination of a thread (see processWorkerExit). Other decrements are performed within getTask.
[中]递减ctl的workerCount字段。这仅在线程突然终止时调用(请参阅processWorkerExit)。其他减量在getTask中执行。

代码示例

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

/**
 * Rolls back the worker thread creation.
 * - removes worker from workers, if present
 * - decrements worker count
 * - rechecks for termination, in case the existence of this
 *   worker was holding up termination
 */
private void addWorkerFailed(Worker w) {
  final ReentrantLock mainLock = this.mainLock;
  mainLock.lock();
  try {
    if (w != null)
      workers.remove(w);
    decrementWorkerCount();
    tryTerminate();
  } finally {
    mainLock.unlock();
  }
}

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

decrementWorkerCount();
return null;

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

decrementWorkerCount();

代码示例来源:origin: MobiVM/robovm

/**
 * Rolls back the worker thread creation.
 * - removes worker from workers, if present
 * - decrements worker count
 * - rechecks for termination, in case the existence of this
 *   worker was holding up termination
 */
private void addWorkerFailed(Worker w) {
  final ReentrantLock mainLock = this.mainLock;
  mainLock.lock();
  try {
    if (w != null)
      workers.remove(w);
    decrementWorkerCount();
    tryTerminate();
  } finally {
    mainLock.unlock();
  }
}

代码示例来源:origin: ibinti/bugvm

/**
 * Rolls back the worker thread creation.
 * - removes worker from workers, if present
 * - decrements worker count
 * - rechecks for termination, in case the existence of this
 *   worker was holding up termination
 */
private void addWorkerFailed(Worker w) {
  final ReentrantLock mainLock = this.mainLock;
  mainLock.lock();
  try {
    if (w != null)
      workers.remove(w);
    decrementWorkerCount();
    tryTerminate();
  } finally {
    mainLock.unlock();
  }
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * Rolls back the worker thread creation.
 * - removes worker from workers, if present
 * - decrements worker count
 * - rechecks for termination, in case the existence of this
 *   worker was holding up termination
 */
private void addWorkerFailed(Worker w) {
  final ReentrantLock mainLock = this.mainLock;
  mainLock.lock();
  try {
    if (w != null)
      workers.remove(w);
    decrementWorkerCount();
    tryTerminate();
  } finally {
    mainLock.unlock();
  }
}

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * Rolls back the worker thread creation.
 * - removes worker from workers, if present
 * - decrements worker count
 * - rechecks for termination, in case the existence of this
 *   worker was holding up termination
 */
private void addWorkerFailed(Worker w) {
  final ReentrantLock mainLock = this.mainLock;
  mainLock.lock();
  try {
    if (w != null)
      workers.remove(w);
    decrementWorkerCount();
    tryTerminate();
  } finally {
    mainLock.unlock();
  }
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * Rolls back the worker thread creation.
 * - removes worker from workers, if present
 * - decrements worker count
 * - rechecks for termination, in case the existence of this
 *   worker was holding up termination
 */
private void addWorkerFailed(Worker w) {
  final ReentrantLock mainLock = this.mainLock;
  mainLock.lock();
  try {
    if (w != null)
      workers.remove(w);
    decrementWorkerCount();
    tryTerminate();
  } finally {
    mainLock.unlock();
  }
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * Rolls back the worker thread creation.
 * - removes worker from workers, if present
 * - decrements worker count
 * - rechecks for termination, in case the existence of this
 *   worker was holding up termination
 */
private void addWorkerFailed(Worker w) {
  final ReentrantLock mainLock = this.mainLock;
  mainLock.lock();
  try {
    if (w != null)
      workers.remove(w);
    decrementWorkerCount();
    tryTerminate();
  } finally {
    mainLock.unlock();
  }
}

代码示例来源:origin: MobiVM/robovm

decrementWorkerCount();
return null;

代码示例来源:origin: ibinti/bugvm

decrementWorkerCount();
return null;

代码示例来源:origin: MobiVM/robovm

decrementWorkerCount();

代码示例来源:origin: ibinti/bugvm

decrementWorkerCount();

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

decrementWorkerCount();

代码示例来源:origin: com.gluonhq/robovm-rt

decrementWorkerCount();

代码示例来源:origin: com.bugvm/bugvm-rt

decrementWorkerCount();

代码示例来源:origin: org.apidesign.bck2brwsr/emul

decrementWorkerCount();

代码示例来源:origin: org.codehaus.jsr166-mirror/jsr166

decrementWorkerCount();

代码示例来源:origin: jtulach/bck2brwsr

decrementWorkerCount();

代码示例来源:origin: FlexoVM/flexovm

decrementWorkerCount();

相关文章

ThreadPoolExecutor类方法