本文整理了Java中com.gemstone.gemfire.internal.cache.locks.QueuedSynchronizer.hasQueuedThreads
方法的一些代码示例,展示了QueuedSynchronizer.hasQueuedThreads
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueuedSynchronizer.hasQueuedThreads
方法的具体详情如下:
包路径:com.gemstone.gemfire.internal.cache.locks.QueuedSynchronizer
类名称:QueuedSynchronizer
方法名:hasQueuedThreads
[英]Queries whether any threads are waiting to acquire. Note that because cancellations due to interrupts and timeouts may occur at any time, a true return does not guarantee that any other thread will ever acquire.
In this implementation, this operation returns in constant time.
[中]查询是否有线程正在等待获取。请注意,由于中断和超时导致的取消可能随时发生,因此真正的返回并不保证任何其他线程都会获得。
在这个实现中,这个操作以恒定的时间返回。
代码示例来源:origin: io.snappydata/gemfirexd-core
/**
* Queries whether any threads are waiting to acquire the read or write lock.
* Note that because cancellations may occur at any time, a {@code true}
* return does not guarantee that any other thread will ever acquire a lock.
* This method is designed primarily for use in monitoring of the system
* state.
*
* @return {@code true} if there may be other threads waiting to acquire the
* lock
*/
public final boolean hasQueuedThreads() {
return this.sync.hasQueuedThreads();
}
代码示例来源:origin: io.snappydata/snappydata-store-core
/**
* Queries whether any threads are waiting to acquire the read or write lock.
* Note that because cancellations may occur at any time, a {@code true}
* return does not guarantee that any other thread will ever acquire a lock.
* This method is designed primarily for use in monitoring of the system
* state.
*
* @return {@code true} if there may be other threads waiting to acquire the
* lock
*/
public final boolean hasQueuedThreads() {
return this.sync.hasQueuedThreads();
}
代码示例来源:origin: io.snappydata/gemfirexd
/**
* Queries whether any threads are waiting to acquire the read or write lock.
* Note that because cancellations may occur at any time, a {@code true}
* return does not guarantee that any other thread will ever acquire a lock.
* This method is designed primarily for use in monitoring of the system
* state.
*
* @return {@code true} if there may be other threads waiting to acquire the
* lock
*/
public final boolean hasQueuedThreads() {
return this.sync.hasQueuedThreads();
}
代码示例来源:origin: io.snappydata/gemfire-core
/**
* Returns a string identifying this synchronizer. Either {@code "nonempty"}
* or {@code "empty"} depending on whether the queue is empty.
*
* @return a string identifying this synchronizer
*/
public final StringBuilder toString(final StringBuilder sb) {
final String q = hasQueuedThreads() ? "non-" : "";
return sb.append(", ").append(q).append("empty queue");
}
内容来源于网络,如有侵权,请联系作者删除!