5 |
|
*/ |
6 |
|
|
7 |
|
package jsr166e.extra; |
8 |
+ |
|
9 |
|
import java.util.concurrent.TimeUnit; |
10 |
|
import java.util.concurrent.TimeoutException; |
11 |
|
import java.util.concurrent.locks.Lock; |
110 |
|
private static final long serialVersionUID = 7373984872572414699L; |
111 |
|
|
112 |
|
static final class Sync extends AbstractQueuedLongSynchronizer { |
113 |
< |
static final long serialVersionUID = 2540673546047039555L; |
113 |
> |
private static final long serialVersionUID = 2540673546047039555L; |
114 |
|
|
115 |
|
/** |
116 |
|
* The number of times to spin in lock() and awaitAvailability(). |
258 |
|
|
259 |
|
/** |
260 |
|
* Creates an instance of {@code SequenceLock} that will retry |
261 |
< |
* attempts to acquire the lock at least the given number times |
261 |
> |
* attempts to acquire the lock at least the given number of times |
262 |
|
* before blocking. |
263 |
+ |
* |
264 |
+ |
* @param spins the number of times before blocking |
265 |
|
*/ |
266 |
|
public SequenceLock(int spins) { sync = new Sync(spins); } |
267 |
|
|
511 |
|
* Throws UnsupportedOperationException. SequenceLocks |
512 |
|
* do not support Condition objects. |
513 |
|
* |
514 |
< |
* @throws UnsupportedOperationException |
514 |
> |
* @throws UnsupportedOperationException always |
515 |
|
*/ |
516 |
|
public Condition newCondition() { |
517 |
|
throw new UnsupportedOperationException(); |