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

x33g5p2x  于2022-01-18 转载在 其他  
字(8.8k)|赞(0)|评价(0)|浏览(123)

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

CyclicBarrier.breakBarrier介绍

[英]Sets current barrier generation as broken and wakes up everyone. Called only while holding lock.
[中]将当前障碍生成设置为已打破并唤醒所有人。仅在持有锁时调用。

代码示例

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

/**
 * Resets the barrier to its initial state.  If any parties are
 * currently waiting at the barrier, they will return with a
 * {@link BrokenBarrierException}. Note that resets <em>after</em>
 * a breakage has occurred for other reasons can be complicated to
 * carry out; threads need to re-synchronize in some other way,
 * and choose one to perform the reset.  It may be preferable to
 * instead create a new barrier for subsequent use.
 */
public void reset() {
  final ReentrantLock lock = this.lock;
  lock.lock();
  try {
    breakBarrier();   // break the current generation
    nextGeneration(); // start a new generation
  } finally {
    lock.unlock();
  }
}

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

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

breakBarrier();
throw new InterruptedException();
} finally {
  if (!ranAction)
    breakBarrier();
} catch (InterruptedException ie) {
  if (g == generation && ! g.broken) {
    breakBarrier();
    throw ie;
  } else {
  breakBarrier();
  throw new TimeoutException();

相关文章