本文整理匯總了Java中com.google.common.util.concurrent.Uninterruptibles.putUninterruptibly方法的典型用法代碼示例。如果您正苦於以下問題:Java Uninterruptibles.putUninterruptibly方法的具體用法?Java Uninterruptibles.putUninterruptibly怎麽用?Java Uninterruptibles.putUninterruptibly使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.util.concurrent.Uninterruptibles
的用法示例。
在下文中一共展示了Uninterruptibles.putUninterruptibly方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
import com.google.common.util.concurrent.Uninterruptibles; //導入方法依賴的package包/類
@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);
}