com.google.common.util.concurrent.Uninterruptibles#putUninterruptibly ( )源码实例Demo

下面列出了com.google.common.util.concurrent.Uninterruptibles#putUninterruptibly ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: bcm-android   文件: Threading.java
@Override
public void execute(Runnable command) {
    final int size = tasks.size();
    if (size == WARNING_THRESHOLD) {
        log.warn(
                "User thread has {} pending tasks, memory exhaustion may occur.\n" +
                        "If you see this message, check your memory consumption and see if it's problematic or excessively spikey.\n" +
                        "If it is, check for deadlocked or slow event handlers. If it isn't, try adjusting the constant \n" +
                        "Threading.UserThread.WARNING_THRESHOLD upwards until it's a suitable level for your app, or Integer.MAX_VALUE to disable.", size);
    }
    Uninterruptibles.putUninterruptibly(tasks, command);
}
 
源代码2 项目: green_android   文件: Threading.java
@Override
public void execute(Runnable command) {
    final int size = tasks.size();
    if (size == WARNING_THRESHOLD) {
        log.warn(
            "User thread has {} pending tasks, memory exhaustion may occur.\n" +
            "If you see this message, check your memory consumption and see if it's problematic or excessively spikey.\n" +
            "If it is, check for deadlocked or slow event handlers. If it isn't, try adjusting the constant \n" +
            "Threading.UserThread.WARNING_THRESHOLD upwards until it's a suitable level for your app, or Integer.MAX_VALUE to disable." , size);
    }
    Uninterruptibles.putUninterruptibly(tasks, command);
}
 
源代码3 项目: GreenBits   文件: Threading.java
@Override
public void execute(Runnable command) {
    final int size = tasks.size();
    if (size == WARNING_THRESHOLD) {
        log.warn(
            "User thread has {} pending tasks, memory exhaustion may occur.\n" +
            "If you see this message, check your memory consumption and see if it's problematic or excessively spikey.\n" +
            "If it is, check for deadlocked or slow event handlers. If it isn't, try adjusting the constant \n" +
            "Threading.UserThread.WARNING_THRESHOLD upwards until it's a suitable level for your app, or Integer.MAX_VALUE to disable." , size);
    }
    Uninterruptibles.putUninterruptibly(tasks, command);
}
 
源代码4 项目: bitherj   文件: Threading.java
@Override
public void execute(Runnable command) {
    if (tasks.size() > 100) {
        log.warn("User thread saturated, memory exhaustion may occur.");
        log.warn("Check for deadlocked or slow event handlers. Sample tasks:");
        for (Object task : tasks.toArray()) log.warn(task.toString());
    }
    Uninterruptibles.putUninterruptibly(tasks, command);
}
 
源代码5 项目: bazel   文件: AsynchronousFileOutputStream.java
/**
 * Writes the byte buffer into the file asynchronously.
 *
 * <p>The writes are guaranteed to land in the output file in the same order that they were
 * called; However, some writes may fail, leaving the file partially corrupted. In case a write
 * fails, an exception will be propagated in close, but remaining writes will be allowed to
 * continue.
 */
@Override
public void write(byte[] data) {
  Preconditions.checkNotNull(data);
  if (closeFuture.isDone()) {
    if (exception.get() != null) {
      // There was a write failure. Silently return without doing anything.
      return;
    } else {
      // The file was closed.
      throw new IllegalStateException();
    }
  }
  Uninterruptibles.putUninterruptibly(queue, data);
}
 
源代码6 项目: jelectrum   文件: Threading.java
@Override
public void execute(Runnable command) {
    final int size = tasks.size();
    if (size == WARNING_THRESHOLD) {
        log.warn(
            "User thread has {} pending tasks, memory exhaustion may occur.\n" +
            "If you see this message, check your memory consumption and see if it's problematic or excessively spikey.\n" +
            "If it is, check for deadlocked or slow event handlers. If it isn't, try adjusting the constant \n" +
            "Threading.UserThread.WARNING_THRESHOLD upwards until it's a suitable level for your app, or Integer.MAX_VALUE to disable." , size);
    }
    Uninterruptibles.putUninterruptibly(tasks, command);
}
 
源代码7 项目: bazel   文件: AsynchronousFileOutputStream.java
/**
 * Returns a future that will close the stream when all pending writes are completed.
 *
 * Any failed writes will propagate an exception.
 */
public ListenableFuture<Void> closeAsync() {
  Uninterruptibles.putUninterruptibly(queue, POISON_PILL);
  return closeFuture;
}