protected boolean doRelease (Uid u, boolean all) { synchronized (super.lockStore.getClass()) { return super.doRelease(u, all); } }
/** * This method *must* be called in the finalizer of every object. It ensures * that any necessary cleanup work is done in the event that the object goes * out of scope within a transaction. */ protected void terminate () { if (txojLogger.logger.isTraceEnabled()) { txojLogger.logger.trace("LockManager::terminate() for object-id " + get_uid()); } cleanUp(); super.terminate(); }
public boolean propagate (Uid from, Uid to) { synchronized (super.lockStore.getClass()) { return super.propagate(from, to); } }
int retryCount = 10; if (lockMutex()) if (loadState()) freeState(); result = unloadState(); freeState(); unlockMutex();
&& ((retry >= 0) || ((retry == LockManager.waitTotalTimeout) && (sleepTime > 0)))) Object syncObject = ((currAct == null) ? getMutex() : currAct); if (loadState()) conflict = lockConflict(toSet); && (conflict == ConflictType.COMPATIBLE)) if (!unloadState()) freeState(); freeState();
protected final void cleanUp () txojLogger.logger.trace("LockManager::cleanUp() for object-id " + get_uid()); if (lockMutex()) && (systemKey == null)) initialise(); unlockMutex();
private final void cleanUp () txojLogger.logger.trace("LockManager::cleanUp() for object-id " + get_uid()); && (systemKey == null)) initialise();
if ((systemKey == null) && !initialise()) S = lockStore.read_state(get_uid(), type());
public final int setlock (Lock toSet) { return setlock(toSet, LockManager.defaultRetry, LockManager.defaultSleepTime); }
if (loadState()) freeState(); result = unloadState(); freeState();
protected final int lockConflict (Lock otherLock) { if (txojLogger.logger.isTraceEnabled()) { txojLogger.logger.trace("LockManager::lockConflict(" + otherLock.get_uid() + ")"); } boolean matching = false; Lock heldLock = null; LockListIterator next = new LockListIterator(locksHeld); while ((heldLock = next.iterate()) != null) { if (heldLock.conflictsWith(otherLock)) { if (LockManager.nestedLocking) { if (!isAncestorOf(heldLock)) /* not quite Moss's rules */ return ConflictType.CONFLICT; } else return ConflictType.CONFLICT; } else { if (heldLock.equals(otherLock)) matching = true; } } return (matching ? ConflictType.PRESENT : ConflictType.COMPATIBLE); }
public Uid get_uid () { if (_txObject == null) throw new RuntimeException("Transactional object is null!"); return _txObject.get_uid(); }
/** * Cleanup. Note we grab the semaphore before destroying the the lock store * to ensure the store is deleted cleanly. */ public void finalize () throws Throwable { if (txojLogger.aitLogger.isDebugEnabled()) { txojLogger.aitLogger.debug(DebugLevel.DESTRUCTORS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_CONCURRENCY_CONTROL, "LockManager.finalize()"); } boolean doSignal = false; cleanUp(); if (mutex != null) { if (mutex.lock() == Semaphore.SM_LOCKED) doSignal = true; } locksHeld = null; lockStore = null; conflictManager = null; if (doSignal) // mutex must be set mutex.unlock(); mutex = null; super.finalize(); }
int retryCount = 10; if (lockMutex()) if (loadState()) freeState(); result = unloadState(); freeState(); unlockMutex();
&& ((retry >= 0) || ((retry == LockManager.waitTotalTimeout) && (sleepTime > 0)))) Object syncObject = ((currAct == null) ? getMutex() : currAct); if (loadState()) conflict = lockConflict(toSet); && (conflict == ConflictType.COMPATIBLE)) if (!unloadState()) freeState(); freeState();