109 |
|
private static final long serialVersionUID = 7373984872572414699L; |
110 |
|
|
111 |
|
static final class Sync extends AbstractQueuedLongSynchronizer { |
112 |
+ |
static final long serialVersionUID = 2540673546047039555L; |
113 |
+ |
|
114 |
|
/** |
115 |
|
* The number of times to spin in lock() and awaitAvailability(). |
116 |
|
*/ |
162 |
|
|
163 |
|
public final long tryAcquireShared(long unused) { |
164 |
|
return (((getState() & 1L) == 0L) ? 1L : |
165 |
< |
(getExclusiveOwnerThread() == Thread.currentThread()) ? 0L: |
165 |
> |
(getExclusiveOwnerThread() == Thread.currentThread()) ? 0L: |
166 |
|
-1L); |
167 |
|
} |
168 |
|
|
503 |
|
* @throws IllegalMonitorStateException if the current thread does not |
504 |
|
* hold this lock |
505 |
|
*/ |
506 |
< |
public void unlock() { sync.release(1); } |
506 |
> |
public void unlock() { sync.release(1); } |
507 |
|
|
508 |
|
/** |
509 |
|
* Throws UnsupportedOperationException. SequenceLocks |
511 |
|
* |
512 |
|
* @throws UnsupportedOperationException |
513 |
|
*/ |
514 |
< |
public Condition newCondition() { |
514 |
> |
public Condition newCondition() { |
515 |
|
throw new UnsupportedOperationException(); |
516 |
|
} |
517 |
|
|
527 |
|
* @return the number of holds on this lock by the current thread, |
528 |
|
* or zero if this lock is not held by the current thread |
529 |
|
*/ |
530 |
< |
public long getHoldCount() { return sync.getHoldCount(); } |
530 |
> |
public long getHoldCount() { return sync.getHoldCount(); } |
531 |
|
|
532 |
|
/** |
533 |
|
* Queries if this lock is held by the current thread. |