com.gemstone.gemfire.internal.cache.locks.QueuedSynchronizer.setOwnerThread()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中com.gemstone.gemfire.internal.cache.locks.QueuedSynchronizer.setOwnerThread方法的一些代码示例,展示了QueuedSynchronizer.setOwnerThread的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueuedSynchronizer.setOwnerThread方法的具体详情如下:
包路径:com.gemstone.gemfire.internal.cache.locks.QueuedSynchronizer
类名称:QueuedSynchronizer
方法名:setOwnerThread

QueuedSynchronizer.setOwnerThread介绍

暂无

代码示例

代码示例来源:origin: io.snappydata/gemfire-core

/**
 * @see ExclusiveSharedSynchronizer#setOwnerId(Object, Object)
 */
@Override
protected final void setOwnerId(Object owner, Object context) {
 this.ownerId = owner;
 this.sync.setOwnerThread();
}

代码示例来源:origin: io.snappydata/gemfire-core

/**
 * Attempts to acquire in exclusive mode. This method should query if the
 * state of the object permits it to be acquired in the exclusive mode, and if
 * so to acquire it.
 * 
 * <p>
 * This method is always invoked by the thread performing acquire. If this
 * method reports failure, the acquire method may queue the thread, if it is
 * not already queued, until it is signalled by a release from some other
 * thread.
 * 
 * @return true if the acquire succeeded and false otherwise
 */
private final boolean tryAcquire() {
 if (compareAndSet(0, WRITE_MASK)) {
  this.sync.setOwnerThread();
  return true;
 }
 else {
  return false;
 }
}

代码示例来源:origin: io.snappydata/gemfire-core

/**
 * Attempts to acquire in exclusive mode. This method should query if the
 * state of the object permits it to be acquired in the exclusive mode, and if
 * so to acquire it.
 * 
 * <p>
 * This method is always invoked by the thread performing acquire. If this
 * method reports failure, the acquire method may queue the thread, if it is
 * not already queued, until it is signalled by a release from some other
 * thread.
 * 
 * @return true if the acquire succeeded and false otherwise
 */
private final boolean tryAcquire() {
 if (compareAndSet(0, 1)) {
  this.sync.setOwnerThread();
  return true;
 }
 else {
  return false;
 }
}

代码示例来源:origin: io.snappydata/gemfirexd

if (compareAndSet(0, EXCLUSIVE_ONE)) {
 this.lockOwner = owner;
 this.sync.setOwnerThread();
 return 1;
this.sync.setOwnerThread();
if (currentWriteHolds != MAX_EXCLUSIVE_COUNT_1) {
 return 1;

代码示例来源:origin: io.snappydata/gemfirexd-core

if (compareAndSet(0, EXCLUSIVE_ONE)) {
 this.lockOwner = owner;
 this.sync.setOwnerThread();
 return 1;
this.sync.setOwnerThread();
if (currentWriteHolds != MAX_EXCLUSIVE_COUNT_1) {
 return 1;

代码示例来源:origin: io.snappydata/snappydata-store-core

if (compareAndSet(0, EXCLUSIVE_ONE)) {
 this.lockOwner = owner;
 this.sync.setOwnerThread();
 return 1;
this.sync.setOwnerThread();
if (currentWriteHolds != MAX_EXCLUSIVE_COUNT_1) {
 return 1;

相关文章