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

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

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

Monitor.awaitUninterruptibly介绍

暂无

代码示例

代码示例来源:origin: google/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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

代码示例来源:origin: google/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 signalBeforeWaiting = lock.isHeldByCurrentThread();
 lock.lock();
 boolean satisfied = false;
 try {
  if (!guard.isSatisfied()) {
   awaitUninterruptibly(guard, signalBeforeWaiting);
  }
  satisfied = true;
 } finally {
  if (!satisfied) {
   leave();
  }
 }
}

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

/**
 * 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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

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

/** 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 signalBeforeWaiting = lock.isHeldByCurrentThread();
 lock.lock();
 boolean satisfied = false;
 try {
  if (!guard.isSatisfied()) {
   awaitUninterruptibly(guard, signalBeforeWaiting);
  }
  satisfied = true;
 } finally {
  if (!satisfied) {
   leave();
  }
 }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * 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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * 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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * 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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

代码示例来源:origin: Nextdoor/bender

/**
 * 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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

代码示例来源:origin: com.google.guava/guava-jdk5

/**
 * 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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

代码示例来源:origin: com.diffplug.guava/guava-concurrent

/**
 * 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) & lock.isHeldByCurrentThread())) {
    throw new IllegalMonitorStateException();
  }
  if (!guard.isSatisfied()) {
    awaitUninterruptibly(guard, true);
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * 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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

/**
 * 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) & lock.isHeldByCurrentThread())) {
  throw new IllegalMonitorStateException();
 }
 if (!guard.isSatisfied()) {
  awaitUninterruptibly(guard, true);
 }
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/** 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 signalBeforeWaiting = lock.isHeldByCurrentThread();
 lock.lock();
 boolean satisfied = false;
 try {
  if (!guard.isSatisfied()) {
   awaitUninterruptibly(guard, signalBeforeWaiting);
  }
  satisfied = true;
 } finally {
  if (!satisfied) {
   leave();
  }
 }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * 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 signalBeforeWaiting = lock.isHeldByCurrentThread();
 lock.lock();
 boolean satisfied = false;
 try {
  if (!guard.isSatisfied()) {
   awaitUninterruptibly(guard, signalBeforeWaiting);
  }
  satisfied = true;
 } finally {
  if (!satisfied) {
   leave();
  }
 }
}

代码示例来源:origin: com.diffplug.guava/guava-concurrent

/**
 * 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 signalBeforeWaiting = lock.isHeldByCurrentThread();
  lock.lock();
  boolean satisfied = false;
  try {
    if (!guard.isSatisfied()) {
      awaitUninterruptibly(guard, signalBeforeWaiting);
    }
    satisfied = true;
  } finally {
    if (!satisfied) {
      leave();
    }
  }
}

代码示例来源:origin: com.google.guava/guava-jdk5

/**
 * 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 signalBeforeWaiting = lock.isHeldByCurrentThread();
 lock.lock();
 boolean satisfied = false;
 try {
  if (!guard.isSatisfied()) {
   awaitUninterruptibly(guard, signalBeforeWaiting);
  }
  satisfied = true;
 } finally {
  if (!satisfied) {
   leave();
  }
 }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.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 signalBeforeWaiting = lock.isHeldByCurrentThread();
 lock.lock();
 boolean satisfied = false;
 try {
  if (!guard.isSatisfied()) {
   awaitUninterruptibly(guard, signalBeforeWaiting);
  }
  satisfied = true;
 } finally {
  if (!satisfied) {
   leave();
  }
 }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * 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 signalBeforeWaiting = lock.isHeldByCurrentThread();
 lock.lock();
 boolean satisfied = false;
 try {
  if (!guard.isSatisfied()) {
   awaitUninterruptibly(guard, signalBeforeWaiting);
  }
  satisfied = true;
 } finally {
  if (!satisfied) {
   leave();
  }
 }
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/** 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 signalBeforeWaiting = lock.isHeldByCurrentThread();
 lock.lock();
 boolean satisfied = false;
 try {
  if (!guard.isSatisfied()) {
   awaitUninterruptibly(guard, signalBeforeWaiting);
  }
  satisfied = true;
 } finally {
  if (!satisfied) {
   leave();
  }
 }
}

相关文章