com.google.common.util.concurrent.Monitor.signalConditionsOfSatisfiedGuards()方法的使用及代码示例

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

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

Monitor.signalConditionsOfSatisfiedGuards介绍

暂无

代码示例

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

/**
 * Leaves this monitor. May be called only by a thread currently occupying this monitor.
 */
public void leave() {
 final ReentrantLock lock = this.lock;
 if (!lock.isHeldByCurrentThread()) {
  throw new IllegalMonitorStateException();
 }
 try {
  signalConditionsOfSatisfiedGuards(null);
 } finally {
  lock.unlock();
 }
}

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

/**
 * Leaves this monitor. May be called only by a thread currently occupying this monitor.
 */
public void leave() {
 final ReentrantLock lock = this.lock;
 if (!lock.isHeldByCurrentThread()) {
  throw new IllegalMonitorStateException();
 }
 try {
  signalConditionsOfSatisfiedGuards(null);
 } finally {
  lock.unlock();
 }
}

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

if (!guard.isSatisfied()) {
 if (signalBeforeWaiting) {
  signalConditionsOfSatisfiedGuards(null);
   } catch (InterruptedException interrupt) {
    try {
     signalConditionsOfSatisfiedGuards(guard);
    } catch (Throwable throwable) {
     Thread.currentThread().interrupt();

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

@GuardedBy("lock")
private void waitInterruptibly(Guard guard, boolean signalBeforeWaiting)
  throws InterruptedException {
 if (!guard.isSatisfied()) {
  if (signalBeforeWaiting) {
   signalConditionsOfSatisfiedGuards(null);
  }
  incrementWaiters(guard);
  try {
   final Condition condition = guard.condition;
   do {
    try {
     condition.await();
    } catch (InterruptedException interrupt) {
     try {
      signalConditionsOfSatisfiedGuards(guard);
     } catch (Throwable throwable) {
      Thread.currentThread().interrupt();
      throw Throwables.propagate(throwable);
     }
     throw interrupt;
    }
   } while (!guard.isSatisfied());
  } finally {
   decrementWaiters(guard);
  }
 }
}

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

@GuardedBy("lock")
private void waitInterruptibly(Guard guard, boolean signalBeforeWaiting)
  throws InterruptedException {
 if (!guard.isSatisfied()) {
  if (signalBeforeWaiting) {
   signalConditionsOfSatisfiedGuards(null);
  }
  incrementWaiters(guard);
  try {
   final Condition condition = guard.condition;
   do {
    try {
     condition.await();
    } catch (InterruptedException interrupt) {
     try {
      signalConditionsOfSatisfiedGuards(guard);
     } catch (Throwable throwable) {
      Thread.currentThread().interrupt();
      throw Throwables.propagate(throwable);
     }
     throw interrupt;
    }
   } while (!guard.isSatisfied());
  } finally {
   decrementWaiters(guard);
  }
 }
}

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

long startNanos = System.nanoTime();
if (signalBeforeWaiting) {
 signalConditionsOfSatisfiedGuards(null);
   } catch (InterruptedException ignored) {
    try {
     signalConditionsOfSatisfiedGuards(guard);
    } catch (Throwable throwable) {
     Thread.currentThread().interrupt();

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

if (!guard.isSatisfied()) {
 if (signalBeforeWaiting) {
  signalConditionsOfSatisfiedGuards(null);
   } catch (InterruptedException interrupt) {
    try {
     signalConditionsOfSatisfiedGuards(guard);
    } catch (Throwable throwable) {
     Thread.currentThread().interrupt();

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

long startNanos = System.nanoTime();
if (signalBeforeWaiting) {
 signalConditionsOfSatisfiedGuards(null);
   } catch (InterruptedException ignored) {
    try {
     signalConditionsOfSatisfiedGuards(guard);
    } catch (Throwable throwable) {
     Thread.currentThread().interrupt();

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

@GuardedBy("lock")
private void waitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (!guard.isSatisfied()) {
  if (signalBeforeWaiting) {
   signalConditionsOfSatisfiedGuards(null);
  }
  incrementWaiters(guard);
  try {
   final Condition condition = guard.condition;
   do {
    condition.awaitUninterruptibly();
   } while (!guard.isSatisfied());
  } finally {
   decrementWaiters(guard);
  }
 }
}

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

@GuardedBy("lock")
private void waitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (!guard.isSatisfied()) {
  if (signalBeforeWaiting) {
   signalConditionsOfSatisfiedGuards(null);
  }
  incrementWaiters(guard);
  try {
   final Condition condition = guard.condition;
   do {
    condition.awaitUninterruptibly();
   } while (!guard.isSatisfied());
  } finally {
   decrementWaiters(guard);
  }
 }
}

相关文章