org.jboss.ejb.plugins.lock
Class NonReentrantLock
java.lang.Object
org.jboss.ejb.plugins.lock.NonReentrantLock
- All Implemented Interfaces:
- org.jboss.util.deadlock.Resource
public class NonReentrantLock
- extends Object
- implements org.jboss.util.deadlock.Resource
Implementents a non reentrant lock with deadlock detection
It will throw a ReentranceException if the same thread tries to acquire twice
or the same transaction tries to acquire twice
- Version:
- $Revision: 57209 $
- Author:
- Bill Burke, Alexey Loubyansky
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lockHolder
protected Thread lockHolder
lock
protected Object lock
held
protected volatile int held
holdingTx
protected Transaction holdingTx
NonReentrantLock
public NonReentrantLock()
getResourceHolder
public Object getResourceHolder()
- Specified by:
getResourceHolder
in interface org.jboss.util.deadlock.Resource
acquireNonReentrant
protected boolean acquireNonReentrant(long waitTime,
Transaction miTx)
throws org.jboss.util.deadlock.ApplicationDeadlockException,
InterruptedException,
NonReentrantLock.ReentranceException
- Throws:
org.jboss.util.deadlock.ApplicationDeadlockException
InterruptedException
NonReentrantLock.ReentranceException
acquireReentrant
protected boolean acquireReentrant(long waitTime,
Transaction miTx)
throws org.jboss.util.deadlock.ApplicationDeadlockException,
InterruptedException,
NonReentrantLock.ReentranceException
- Throws:
org.jboss.util.deadlock.ApplicationDeadlockException
InterruptedException
NonReentrantLock.ReentranceException
attempt
public boolean attempt(long waitTime,
Transaction miTx,
boolean nonReentrant)
throws org.jboss.util.deadlock.ApplicationDeadlockException,
InterruptedException,
NonReentrantLock.ReentranceException
- Throws:
org.jboss.util.deadlock.ApplicationDeadlockException
InterruptedException
NonReentrantLock.ReentranceException
release
public void release(boolean nonReentrant)
Copyright © 2002 JBoss Group, LLC. All Rights Reserved.