124 |
|
* @spec JSR-166 |
125 |
|
* @revised $Date$ |
126 |
|
* @editor $Author$ |
127 |
+ |
* @author Doug Lea |
128 |
|
* |
129 |
|
**/ |
130 |
|
public interface Lock { |
143 |
|
* <tt>Lock</tt> implementation. |
144 |
|
* |
145 |
|
**/ |
146 |
< |
public void lock(); |
146 |
> |
void lock(); |
147 |
|
|
148 |
|
/** |
149 |
|
* Acquires the lock unless the current thread is |
187 |
|
* @see Thread#interrupt |
188 |
|
* |
189 |
|
**/ |
190 |
< |
public void lockInterruptibly() throws InterruptedException; |
190 |
> |
void lockInterruptibly() throws InterruptedException; |
191 |
|
|
192 |
|
|
193 |
|
/** |
215 |
|
* @return <tt>true</tt> if the lock was acquired and <tt>false</tt> |
216 |
|
* otherwise. |
217 |
|
**/ |
218 |
< |
public boolean tryLock(); |
218 |
> |
boolean tryLock(); |
219 |
|
|
220 |
|
/** |
221 |
|
* Acquires the lock if it is free within the given waiting time and the |
271 |
|
* @see Thread#interrupt |
272 |
|
* |
273 |
|
**/ |
274 |
< |
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException; |
274 |
> |
boolean tryLock(long time, TimeUnit unit) throws InterruptedException; |
275 |
|
|
276 |
|
/** |
277 |
|
* Releases the lock. |
283 |
|
* Any restrictions and the exception |
284 |
|
* type must be documented by that <tt>Lock</tt> implementation. |
285 |
|
**/ |
286 |
< |
public void unlock(); |
286 |
> |
void unlock(); |
287 |
|
|
288 |
|
/** |
289 |
|
* Returns a {@link Condition} instance that is bound to this <tt>Lock</tt> |
307 |
|
* @throws UnsupportedOperationException if this <tt>Lock</tt> |
308 |
|
* implementation does not support conditions. |
309 |
|
**/ |
310 |
< |
public Condition newCondition(); |
310 |
> |
Condition newCondition(); |
311 |
|
|
312 |
|
} |
313 |
|
|