/** * @see TXStateProxy#hasPreCommitActions() */ @Override public boolean hasPreCommitActions() { // lock should be already held assert this.lock.isLocked(); return this.dbOps.size() > 0; }
@Override public String toString() { return this.lock.toString(); } }
/** * Constructs a new advisor. Also sets up this VM's profile and exchanges it * with other VMs. */ protected VMIdAdvisor(InternalDistributedSystem system) { super(new VMIdAdvisee(system)); this.sys = system; this.dsID = system.getDistributionManager().getDistributedSystemId(); if (this.dsID > DSID_MAX) { throw new IllegalStateException("overflow with DSID=" + this.dsID); } this.mapLock = new StoppableReentrantReadWriteLock(false, true, system.getCancelCriterion()); this.newMemberLock = new StoppableReentrantReadWriteLock(false, true, system.getCancelCriterion()); this.vmIdToMemberMap = new ConcurrentTLongObjectHashMap< InternalDistributedMember>(4, DEFAULT_MAPSIZE); this.memberToVMIdMap = new ConcurrentHashMap< InternalDistributedMember, Long>(DEFAULT_MAPSIZE, 0.75f, 4); this.vmUniqueId = INVALID_ID; this.maxVMUniqueId = new AtomicLong(INVALID_ID); this.sequenceId = new AtomicInteger(INVALID_INT_ID); // initialize with max value to force VM unique ID to be generated the first // time if required this.sequenceIdForShortUUID = new AtomicInteger(INVALID_SHORT_ID); this.vmIdLock = new NonReentrantLock(true, system, system.getCancelCriterion()); this.fineEnabled = system.getLogWriter().fineEnabled(); }
public void releaseWriteLock() { this.lock.unlock(); }
public void acquireWriteLock() throws InterruptedException { this.lock.lock(); }
LogWriterI18n logger = null; int waitThreshold = 0; if (this.useWaitThreshold && (waitThreshold = getWaitThreshold()) > 0) { timeoutMillis = TimeUnit.SECONDS.toMillis(waitThreshold); logger = getDistributedSystem(true).getLogWriterI18n(); getCancelCriterion().checkCancelInProgress(null); msecs -= timeoutMillis; if (logger.warningEnabled()) { "NonReentrantLock", Double.toString((double)timeoutMillis / 1000.0), "WRITE", "this object", toString(), msecs });
/** * @see Checkpoint#attemptLock(long) */ public boolean attemptLock(long msecs) { return this.sync.attemptLock(msecs); }
this.head.next = this.head.previous = this.head; this.headLock = this.proxy.lock; this.txLock = new NonReentrantLock(true); this.txLocked = new AtomicBoolean(false); this.isGFXD = this.proxy.isGFXD;
public void releaseReadLock() { this.lock.unlock(); }
public void acquireReadLock() throws InterruptedException { this.lock.lock(); }
/** * @see TXStateProxy#hasPreCommitActions() */ @Override public boolean hasPreCommitActions() { // lock should be already held assert this.lock.isLocked(); return this.dbOps.size() > 0; }
this.reusableStatement = (EngineStatement)conn.createStatement(); this.registeredStatements = new ArrayList<>(4); this.sync = new NonReentrantLock(true); this.startTime = System.currentTimeMillis();
final void unlockTXState() { this.txLock.unlock(); if (ExclusiveSharedSynchronizer.TRACE_LOCK_COMPACT) { final LogWriterI18n logger = getTxMgr().getLogger(); logger.info(LocalizedStrings.DEBUG, "released lock on " + toString()); } }
public final void lockTXState() { this.txLock.lock(); if (ExclusiveSharedSynchronizer.TRACE_LOCK_COMPACT) { final LogWriterI18n logger = getTxMgr().getLogger(); logger.info(LocalizedStrings.DEBUG, "acquired lock on " + toString()); } }
/** * @see TXStateProxy#hasPreCommitActions() */ @Override public boolean hasPreCommitActions() { // lock should be already held assert this.lock.isLocked(); return this.dbOps.size() > 0; }
this.reusableStatement = (EmbedStatement)conn.createStatement(); this.activeStatements = new ArrayList<StatementHolder>(4); this.sync = new NonReentrantLock(true);