本文整理了Java中org.wildfly.common.Assert.assertNotHoldsLock()
方法的一些代码示例,展示了Assert.assertNotHoldsLock()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Assert.assertNotHoldsLock()
方法的具体详情如下:
包路径:org.wildfly.common.Assert
类名称:Assert
方法名:assertNotHoldsLock
[英]Assert that the given monitor is not held by the current thread. Use a standard assertion failure message if it is. Only runs if assert is enabled.
[中]断言给定的监视器不由当前线程持有。如果是,请使用标准的断言失败消息。仅在启用assert时运行。
代码示例来源:origin: wildfly/wildfly
/**
* Wait to determine whether this invocation was cancelled.
*
* @return {@code true} if the invocation was cancelled; {@code false} if it completed or failed or the thread was
* interrupted
*/
public boolean awaitCancellationResult() {
final Object lock = this.lock;
Assert.assertNotHoldsLock(lock);
synchronized (lock) {
for (;;) {
if (resultProducer == CANCELLED) {
return true;
} else if (! state.isWaiting()) {
return false;
}
try {
checkStateInvariants();
lock.wait();
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
return false;
}
}
}
}
代码示例来源:origin: wildfly/wildfly
Assert.assertNotHoldsLock(lock);
final EJBClientInterceptorInformation[] chain = interceptorList.getInformation();
synchronized (lock) {
代码示例来源:origin: org.jboss.eap/wildfly-client-all
/**
* Wait to determine whether this invocation was cancelled.
*
* @return {@code true} if the invocation was cancelled; {@code false} if it completed or failed or the thread was
* interrupted
*/
public boolean awaitCancellationResult() {
final Object lock = this.lock;
Assert.assertNotHoldsLock(lock);
synchronized (lock) {
for (;;) {
if (resultProducer == CANCELLED) {
return true;
} else if (! state.isWaiting()) {
return false;
}
try {
checkStateInvariants();
lock.wait();
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
return false;
}
}
}
}
代码示例来源:origin: wildfly/jboss-ejb-client
/**
* Wait to determine whether this invocation was cancelled.
*
* @return {@code true} if the invocation was cancelled; {@code false} if it completed or failed or the thread was
* interrupted
*/
public boolean awaitCancellationResult() {
final Object lock = this.lock;
Assert.assertNotHoldsLock(lock);
synchronized (lock) {
for (;;) {
if (resultProducer == CANCELLED) {
return true;
} else if (! state.isWaiting()) {
return false;
}
try {
checkStateInvariants();
lock.wait();
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
return false;
}
}
}
}
代码示例来源:origin: org.jboss.eap/wildfly-client-all
Assert.assertNotHoldsLock(lock);
final EJBClientInterceptorInformation[] chain = interceptorList.getInformation();
synchronized (lock) {
代码示例来源:origin: wildfly/jboss-ejb-client
Assert.assertNotHoldsLock(lock);
final EJBClientInterceptorInformation[] chain = interceptorList.getInformation();
synchronized (lock) {
内容来源于网络,如有侵权,请联系作者删除!