本文整理了Java中com.google.common.util.concurrent.Monitor.waitUninterruptibly()
方法的一些代码示例,展示了Monitor.waitUninterruptibly()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Monitor.waitUninterruptibly()
方法的具体详情如下:
包路径:com.google.common.util.concurrent.Monitor
类名称:Monitor
方法名:waitUninterruptibly
暂无
代码示例来源:origin: org.hudsonci.lib.guava/guava
/**
* Waits for the guard to be satisfied. Waits indefinitely. May be called only by a thread
* currently occupying this monitor.
*/
public void waitForUninterruptibly(Guard guard) {
if (guard.monitor != this) {
throw new IllegalMonitorStateException();
}
if (!lock.isHeldByCurrentThread()) {
throw new IllegalMonitorStateException();
}
waitUninterruptibly(guard, true);
}
代码示例来源:origin: org.sonatype.sisu/sisu-guava
/**
* Waits for the guard to be satisfied. Waits indefinitely. May be called only by a thread
* currently occupying this monitor.
*/
public void waitForUninterruptibly(Guard guard) {
if (guard.monitor != this) {
throw new IllegalMonitorStateException();
}
if (!lock.isHeldByCurrentThread()) {
throw new IllegalMonitorStateException();
}
waitUninterruptibly(guard, true);
}
代码示例来源:origin: org.sonatype.sisu/sisu-guava
/**
* Waits for the guard to be satisfied. Waits at most the given time. May be called only by a
* thread currently occupying this monitor.
*
* @return whether the guard is now satisfied
*/
public boolean waitForUninterruptibly(Guard guard, long time, TimeUnit unit) {
if (guard.monitor != this) {
throw new IllegalMonitorStateException();
}
if (!lock.isHeldByCurrentThread()) {
throw new IllegalMonitorStateException();
}
return waitUninterruptibly(guard, unit.toNanos(time), true);
}
代码示例来源:origin: org.hudsonci.lib.guava/guava
/**
* Waits for the guard to be satisfied. Waits at most the given time. May be called only by a
* thread currently occupying this monitor.
*
* @return whether the guard is now satisfied
*/
public boolean waitForUninterruptibly(Guard guard, long time, TimeUnit unit) {
if (guard.monitor != this) {
throw new IllegalMonitorStateException();
}
if (!lock.isHeldByCurrentThread()) {
throw new IllegalMonitorStateException();
}
return waitUninterruptibly(guard, unit.toNanos(time), true);
}
代码示例来源:origin: org.sonatype.sisu/sisu-guava
/**
* Enters this monitor when the guard is satisfied. Blocks indefinitely.
*/
public void enterWhenUninterruptibly(Guard guard) {
if (guard.monitor != this) {
throw new IllegalMonitorStateException();
}
final ReentrantLock lock = this.lock;
boolean reentrant = lock.isHeldByCurrentThread();
boolean success = false;
lock.lock();
try {
waitUninterruptibly(guard, reentrant);
success = true;
} finally {
if (!success) {
lock.unlock();
}
}
}
代码示例来源:origin: org.hudsonci.lib.guava/guava
/**
* Enters this monitor when the guard is satisfied. Blocks indefinitely.
*/
public void enterWhenUninterruptibly(Guard guard) {
if (guard.monitor != this) {
throw new IllegalMonitorStateException();
}
final ReentrantLock lock = this.lock;
boolean reentrant = lock.isHeldByCurrentThread();
boolean success = false;
lock.lock();
try {
waitUninterruptibly(guard, reentrant);
success = true;
} finally {
if (!success) {
lock.unlock();
}
}
}
代码示例来源:origin: org.hudsonci.lib.guava/guava
satisfied = waitUninterruptibly(guard, remainingNanos, reentrant);
} finally {
if (!satisfied) {
代码示例来源:origin: org.sonatype.sisu/sisu-guava
satisfied = waitUninterruptibly(guard, remainingNanos, reentrant);
} finally {
if (!satisfied) {
内容来源于网络,如有侵权,请联系作者删除!