EDU.oswego.cs.dl.util.concurrent
public class ReentrantLock extends Object implements Sync
| Field Summary | |
|---|---|
| protected long | holds_ |
| protected Thread | owner_ |
| Method Summary | |
|---|---|
| void | acquire() |
| boolean | attempt(long msecs) |
| long | holds()
Return the number of unreleased acquires performed
by the current thread.
|
| void | release()
Release the lock. |
| void | release(long n)
Release the lock N times. |
Throws: Error thrown if not current owner of lock
release(n) is
equivalent in effect to:
for (int i = 0; i < n; ++i) release();
Throws: Error thrown if not current owner of lock or has fewer than N holds on the lock