/** * Determine whether the calling thread owns a lock on the identified * resource. */ public boolean isLockOwner(String lockName) { return getThreadLocks().contains(lockName); }
/** * Determine whether the calling thread owns a lock on the identified * resource. */ public boolean isLockOwner(String lockName) { return getThreadLocks().contains(lockName); }
+ Thread.currentThread().getName()); getThreadLocks().add(lockName);
+ Thread.currentThread().getName()); getThreadLocks().add(lockName);
/** * Release the lock on the identified resource if it is held by the calling * thread. */ public void releaseLock(String lockName) { if (isLockOwner(lockName)) { if(getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' returned by: " + Thread.currentThread().getName()); } getThreadLocks().remove(lockName); //getThreadLocksObtainer().remove(lockName); } else if (getLog().isDebugEnabled()) { getLog().warn( "Lock '" + lockName + "' attempt to return by: " + Thread.currentThread().getName() + " -- but not owner!", new Exception("stack-trace of wrongful returner")); } }
/** * Release the lock on the identified resource if it is held by the calling * thread. */ public void releaseLock(String lockName) { if (isLockOwner(lockName)) { if(getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' returned by: " + Thread.currentThread().getName()); } getThreadLocks().remove(lockName); //getThreadLocksObtainer().remove(lockName); } else if (getLog().isDebugEnabled()) { getLog().warn( "Lock '" + lockName + "' attempt to return by: " + Thread.currentThread().getName() + " -- but not owner!", new Exception("stack-trace of wrongful returner")); } }
/** * Determine whether the calling thread owns a lock on the identified * resource. */ public boolean isLockOwner(Connection conn, String lockName) { lockName = lockName.intern(); return getThreadLocks().contains(lockName); }
/** * Determine whether the calling thread owns a lock on the identified * resource. */ public boolean isLockOwner(Connection conn, String lockName) { lockName = lockName.intern(); return getThreadLocks().contains(lockName); }
/** * Release the lock on the identified resource if it is held by the calling * thread. */ public void releaseLock(Connection conn, String lockName) { lockName = lockName.intern(); if (isLockOwner(conn, lockName)) { if(getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' returned by: " + Thread.currentThread().getName()); } getThreadLocks().remove(lockName); //getThreadLocksObtainer().remove(lockName); } else if (getLog().isDebugEnabled()) { getLog().warn( "Lock '" + lockName + "' attempt to return by: " + Thread.currentThread().getName() + " -- but not owner!", new Exception("stack-trace of wrongful returner")); } }
+ Thread.currentThread().getName()); getThreadLocks().add(lockName);
+ Thread.currentThread().getName()); getThreadLocks().add(lockName);
/** * Release the lock on the identified resource if it is held by the calling * thread. */ public void releaseLock(Connection conn, String lockName) { lockName = lockName.intern(); if (isLockOwner(conn, lockName)) { if(getLog().isDebugEnabled()) { getLog().debug( "Lock '" + lockName + "' returned by: " + Thread.currentThread().getName()); } getThreadLocks().remove(lockName); //getThreadLocksObtainer().remove(lockName); } else if (getLog().isDebugEnabled()) { getLog().warn( "Lock '" + lockName + "' attempt to return by: " + Thread.currentThread().getName() + " -- but not owner!", new Exception("stack-trace of wrongful returner")); } }