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

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

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

Monitor.endWaitingFor介绍

[英]Records that the current thread is no longer waiting on the specified guard.
[中]记录当前线程不再等待指定的保护。

代码示例

代码示例来源:origin: google/guava

@GuardedBy("lock")
private void await(Guard guard, boolean signalBeforeWaiting) throws InterruptedException {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.await();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

代码示例来源:origin: google/guava

/** Caller should check before calling that guard is not satisfied. */
 @GuardedBy("lock")
 private boolean awaitNanos(Guard guard, long nanos, boolean signalBeforeWaiting)
   throws InterruptedException {
  boolean firstTime = true;
  try {
   do {
    if (nanos <= 0L) {
     return false;
    }
    if (firstTime) {
     if (signalBeforeWaiting) {
      signalNextWaiter();
     }
     beginWaitingFor(guard);
     firstTime = false;
    }
    nanos = guard.condition.awaitNanos(nanos);
   } while (!guard.isSatisfied());
   return true;
  } finally {
   if (!firstTime) {
    endWaitingFor(guard);
   }
  }
 }
}

代码示例来源:origin: google/guava

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void await(Guard guard, boolean signalBeforeWaiting) throws InterruptedException {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.await();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

代码示例来源:origin: google/j2objc

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

/** Caller should check before calling that guard is not satisfied. */
 @GuardedBy("lock")
 private boolean awaitNanos(Guard guard, long nanos, boolean signalBeforeWaiting)
   throws InterruptedException {
  boolean firstTime = true;
  try {
   do {
    if (nanos <= 0L) {
     return false;
    }
    if (firstTime) {
     if (signalBeforeWaiting) {
      signalNextWaiter();
     }
     beginWaitingFor(guard);
     firstTime = false;
    }
    nanos = guard.condition.awaitNanos(nanos);
   } while (!guard.isSatisfied());
   return true;
  } finally {
   if (!firstTime) {
    endWaitingFor(guard);
   }
  }
 }
}

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

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava

@GuardedBy("lock")
 private void await(Guard guard, boolean signalBeforeWaiting)
  throws InterruptedException {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.await();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
 private void await(Guard guard, boolean signalBeforeWaiting)
  throws InterruptedException {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.await();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
  if (signalBeforeWaiting) {
    signalNextWaiter();
  }
  beginWaitingFor(guard);
  try {
    do {
      guard.condition.awaitUninterruptibly();
    } while (!guard.isSatisfied());
  } finally {
    endWaitingFor(guard);
  }
}

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

@GuardedBy("lock")
private void await(Guard guard, boolean signalBeforeWaiting) throws InterruptedException {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.await();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void await(Guard guard, boolean signalBeforeWaiting) throws InterruptedException {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.await();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

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

@GuardedBy("lock")
private void awaitUninterruptibly(Guard guard, boolean signalBeforeWaiting) {
 if (signalBeforeWaiting) {
  signalNextWaiter();
 }
 beginWaitingFor(guard);
 try {
  do {
   guard.condition.awaitUninterruptibly();
  } while (!guard.isSatisfied());
 } finally {
  endWaitingFor(guard);
 }
}

相关文章