public class ReentrantLock extends Object
This class represents a reentrant lock with the same semantics as built-in Java synchronized locks: Once a thread has a lock, it can re-obtain it any number of times without blocking.
Constructor and Description |
---|
ReentrantLock()
Default constructor.
|
public void lock()
public boolean tryLock()
true
if the lock was free and was acquired by the
current thread, or the lock was already held by the current
thread; false
otherwise.public void unlock()
unlock()
as lock()
have been performed
on this ReentrantLock
by the current thread.
throws IllegalMonitorStateExeception if the current thread does not hold
this lock.public Thread getOwner()
ReentrantLock
.Copyright © 2005–2013 Javolution. All rights reserved.