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 |
|
|
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. |