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

x33g5p2x  于2022-01-19 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(117)

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

ForkJoinPool.externalHelpQuiescePool介绍

[英]Restricted version of helpQuiescePool for external callers
[中]外部调用者的helpQuiescePool的受限版本

代码示例

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

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

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

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

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

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

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

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

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

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

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

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

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

/**
 * Possibly executes tasks until the pool hosting the current task
 * {@link ForkJoinPool#isQuiescent is quiescent}. This method may
 * be of use in designs in which many tasks are forked, but none
 * are explicitly joined, instead executing them until all are
 * processed.
 */
public static void helpQuiesce() {
  Thread t;
  if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
    ForkJoinWorkerThread wt = (ForkJoinWorkerThread)t;
    wt.pool.helpQuiescePool(wt.workQueue);
  }
  else
    ForkJoinPool.externalHelpQuiescePool();
}

相关文章

ForkJoinPool类方法