org.jboss.cache.lock
Class IdentityLock

Lock object which grants and releases locks, and associates locks with
owners. The methods to acquire and release a lock require an owner
(Object). When a lock is acquired, we store the current owner with the lock.
When the same owner (but possibly running in a different thread)
wants to acquire the lock, it is immediately granted. When an owner
different from the one currently owning the lock wants to release the lock,
we do nothing (no-op).

acquireWriteLock

Acquire a write lock with a timeout of timeout milliseconds.
Note that if the current owner owns a read lock, it will be upgraded
automatically. However, if upgrade fails, i.e., timeout, the read lock will
be released automatically.