本文整理了Java中com.gemstone.gemfire.internal.cache.locks.QueuedSynchronizer.signalWaiters
方法的一些代码示例,展示了QueuedSynchronizer.signalWaiters
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueuedSynchronizer.signalWaiters
方法的具体详情如下:
包路径:com.gemstone.gemfire.internal.cache.locks.QueuedSynchronizer
类名称:QueuedSynchronizer
方法名:signalWaiters
[英]Signal any waiting threads in the queue.
[中]向队列中所有等待的线程发送信号。
代码示例来源:origin: io.snappydata/gemfire-core
/**
* Releases the lock previously acquired by a call to
* {@link #attemptLock(long)}. Implemented by unblocking one or more threads.
*
* @throws IllegalMonitorStateException
* if releasing would place this synchronizer in an illegal state.
* This exception must be thrown in a consistent fashion for
* synchronization to work correctly.
*/
public final void releaseLock() {
tryRelease();
this.sync.signalWaiters();
}
代码示例来源:origin: io.snappydata/gemfire-core
/**
* @see Lock#unlock()
*/
public final void unlock() {
tryRelease();
this.sync.signalWaiters();
}
代码示例来源:origin: io.snappydata/gemfire-core
/**
* Releases in exclusive mode. Implemented by unblocking one or more threads.
*
* @throws IllegalMonitorStateException
* if releasing would place this synchronizer in an illegal state or
* lock is not held by the calling thread. This exception must be
* thrown in a consistent fashion for synchronization to work
* correctly.
*/
public final void releaseWriteLock() {
tryRelease();
this.sync.signalWaiters();
}
代码示例来源:origin: io.snappydata/gemfirexd-core
/**
* @see ReadWriteLockObject#releaseWriteLock(Object)
*/
public void releaseWriteLock(final Object owner) {
final boolean traceLock = traceLock();
if (traceLock) {
final StringBuilder sb = new StringBuilder(
"releaseWriteLock: releasing write lock with owner=").append(owner)
.append(", for ");
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_LOCK, fillSB(sb)
.toString());
}
final boolean result = tryRelease(0 /* not used */, owner, null);
if (result) {
this.sync.signalWaiters();
}
if (traceLock) {
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_LOCK, fillSB(
new StringBuilder("releaseWriteLock: write lock release with owner=")
.append(owner).append(result ? ", successful" : ", unsuccessful")
.append(" for lock ")).toString());
}
}
代码示例来源:origin: io.snappydata/snappydata-store-core
/**
* @see ReadWriteLockObject#releaseWriteLock(Object)
*/
public void releaseWriteLock(final Object owner) {
final boolean traceLock = traceLock();
if (traceLock) {
final StringBuilder sb = new StringBuilder(
"releaseWriteLock: releasing write lock with owner=").append(owner)
.append(", for ");
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_LOCK, fillSB(sb)
.toString());
}
final boolean result = tryRelease(0 /* not used */, owner, null);
if (result) {
this.sync.signalWaiters();
}
if (traceLock) {
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_LOCK, fillSB(
new StringBuilder("releaseWriteLock: write lock release with owner=")
.append(owner).append(result ? ", successful" : ", unsuccessful")
.append(" for lock ")).toString());
}
}
代码示例来源:origin: io.snappydata/gemfirexd
/**
* @see ReadWriteLockObject#releaseWriteLock(Object)
*/
public void releaseWriteLock(final Object owner) {
final boolean traceLock = traceLock();
if (traceLock) {
final StringBuilder sb = new StringBuilder(
"releaseWriteLock: releasing write lock with owner=").append(owner)
.append(", for ");
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_LOCK, fillSB(sb)
.toString());
}
final boolean result = tryRelease(0 /* not used */, owner, null);
if (result) {
this.sync.signalWaiters();
}
if (traceLock) {
SanityManager.DEBUG_PRINT(GfxdConstants.TRACE_LOCK, fillSB(
new StringBuilder("releaseWriteLock: write lock release with owner=")
.append(owner).append(result ? ", successful" : ", unsuccessful")
.append(" for lock ")).toString());
}
}
代码示例来源:origin: io.snappydata/gemfire-core
/**
* Signal any waiting threads in the {@link QueuedSynchronizer}. By default
* the {@link QueuedSynchronizer} is obtained by a call to
* {@link #getQueuedSynchronizer}.
*/
protected void signalQueuedSynchronizer(final Object context,
final boolean shared) {
final QueuedSynchronizer sync = getQueuedSynchronizer(context);
if (shared) {
sync.signalSharedWaiters();
}
else {
sync.clearOwnerThread();
sync.signalWaiters();
}
}
代码示例来源:origin: io.snappydata/gemfire-core
/**
* @see ExclusiveSharedSynchronizer#signalQueuedSynchronizer(Object, boolean)
*/
@Override
protected final void signalQueuedSynchronizer(final Object context,
final boolean shared) {
if (hasWaiters()) {
// if there is waiting thread queue then need to empty that too
final CustomEntryConcurrentHashMap<RegionEntry, QueuedSynchronizer>
lockWaiters = ((LocalRegion)context).getLockWaiters();
final QueuedSynchronizer sync = lockWaiters.get(this);
if (sync != null) {
if (shared) {
sync.signalSharedWaiters();
}
else {
sync.clearOwnerThread();
sync.signalWaiters();
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!