A lock that supports reentrancy based on owner (and not on current thread). For this to work, the lock needs to be constructed with a reference to the {@link org.infinispan.context.InvocationContextContainer}, so it is able to determine whether the caller's "owner" reference is the current thread or a {@link org.infinispan.transaction.xa.GlobalTransaction} instance.
This makes this lock implementation very closely tied to Infinispan internals, but it provides for a very clean, efficient and moreover familiar interface to work with, since it implements {@link java.util.concurrent.locks.Lock}.
For the sake of performance, this lock only supports nonfair queueing.
@author Manik Surtani (
manik@jboss.org)
@author Stuart Douglas
@since 4.0